├── kik_unofficial ├── __init__.py ├── parser │ └── __init__.py ├── datatypes │ ├── __init__.py │ ├── xmpp │ │ └── __init__.py │ └── exceptions.py ├── utilities │ ├── __init__.py │ ├── xml_utilities.py │ ├── kik_server_clock.py │ ├── credential_utilities.py │ └── threading_utils.py ├── http_requests │ ├── __init__.py │ ├── tenor_client.py │ ├── content.py │ └── profile_pictures.py ├── protobuf │ ├── __init__.py │ ├── groups │ │ ├── __init__.py │ │ ├── v1 │ │ │ ├── __init__.py │ │ │ └── group_suggest_service_pb2.py │ │ └── v2 │ │ │ ├── __init__.py │ │ │ └── groups_common_pb2.py │ ├── accounts │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ └── user_info_shared_pb2.py │ ├── common │ │ ├── __init__.py │ │ └── v1 │ │ │ └── __init__.py │ ├── entity │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── subscription_service_pb2.py │ │ │ └── subscription_common_pb2.py │ ├── protobuf_source │ │ ├── messagepath │ │ │ └── v1 │ │ │ │ ├── feature_payment.proto │ │ │ │ ├── text_markdown.proto │ │ │ │ ├── chat_theme.proto │ │ │ │ ├── core_message_options.proto │ │ │ │ ├── mentions.proto │ │ │ │ ├── link_message.proto │ │ │ │ ├── adaptive_cards.proto │ │ │ │ ├── carousels.proto │ │ │ │ ├── core_message_common.proto │ │ │ │ └── widgets.proto │ │ ├── groups │ │ │ ├── v2 │ │ │ │ └── groups_common.proto │ │ │ └── v1 │ │ │ │ └── group_suggest_service.proto │ │ ├── session │ │ │ └── v2 │ │ │ │ └── model.proto │ │ ├── bridgetest │ │ │ └── v1 │ │ │ │ ├── authenticated_service.proto │ │ │ │ ├── preregistration_service.proto │ │ │ │ ├── disabled_service.proto │ │ │ │ └── bridgetest_common.proto │ │ ├── push │ │ │ └── v2 │ │ │ │ └── push_common.proto │ │ ├── kin │ │ │ ├── payment │ │ │ │ └── v1 │ │ │ │ │ └── payment_common.proto │ │ │ └── authentication │ │ │ │ └── v1 │ │ │ │ ├── authentication_service.proto │ │ │ │ └── authentication_common.proto │ │ ├── kik_options.proto │ │ ├── profile │ │ │ ├── v2 │ │ │ │ └── profile_common.proto │ │ │ └── v1 │ │ │ │ └── profile_common.proto │ │ ├── chats │ │ │ └── v2 │ │ │ │ ├── chats_common.proto │ │ │ │ └── chat_info_service.proto │ │ ├── abtesting │ │ │ └── v1 │ │ │ │ ├── ab_testing_shared.proto │ │ │ │ └── ab_service.proto │ │ ├── product │ │ │ └── v1 │ │ │ │ └── product_data_common.proto │ │ ├── matching │ │ │ └── v1 │ │ │ │ └── matching_common.proto │ │ ├── entity │ │ │ └── v1 │ │ │ │ ├── subscription_common.proto │ │ │ │ └── subscription_service.proto │ │ ├── mobile_video_service.proto │ │ ├── protobuf_validation.proto │ │ ├── signal │ │ │ └── v2 │ │ │ │ └── model.proto │ │ ├── badgecount │ │ │ └── v1 │ │ │ │ └── badge_count_service.proto │ │ ├── antispam │ │ │ └── iospushverification │ │ │ │ └── v1 │ │ │ │ └── iospushverification_service.proto │ │ ├── accounts │ │ │ └── v1 │ │ │ │ └── user_info_shared.proto │ │ ├── google │ │ │ └── protobuf │ │ │ │ ├── source_context.proto │ │ │ │ └── empty.proto │ │ ├── asset │ │ │ └── v1 │ │ │ │ └── asset_common.proto │ │ ├── persona │ │ │ └── v2 │ │ │ │ └── persona_service.proto │ │ ├── iam │ │ │ └── v2 │ │ │ │ └── authentication_service.proto │ │ └── common │ │ │ └── v2 │ │ │ └── model.proto │ ├── compile_protobuf.sh │ ├── README.md │ ├── bridgetest │ │ └── v1 │ │ │ ├── disabled_service_pb2.py │ │ │ ├── authenticated_service_pb2.py │ │ │ ├── preregistration_service_pb2.py │ │ │ └── bridgetest_common_pb2.py │ ├── messagepath │ │ └── v1 │ │ │ ├── chat_theme_pb2.py │ │ │ ├── link_message_pb2.py │ │ │ ├── text_markdown_pb2.py │ │ │ ├── feature_payment_pb2.py │ │ │ ├── mentions_pb2.py │ │ │ ├── adaptive_cards_pb2.py │ │ │ ├── core_message_options_pb2.py │ │ │ ├── widgets_pb2.py │ │ │ ├── visibility_rules_pb2.py │ │ │ ├── carousels_pb2.py │ │ │ └── core_message_common_pb2.py │ ├── matching │ │ └── v1 │ │ │ └── matching_common_pb2.py │ ├── mobile_video_service_pb2.py │ ├── kik_options_pb2.py │ ├── session │ │ └── v2 │ │ │ └── model_pb2.py │ ├── kin │ │ ├── authentication │ │ │ └── v1 │ │ │ │ ├── authentication_common_pb2.py │ │ │ │ └── authentication_service_pb2.py │ │ └── payment │ │ │ └── v1 │ │ │ └── payment_common_pb2.py │ ├── signal │ │ └── v2 │ │ │ └── model_pb2.py │ ├── profile │ │ └── v2 │ │ │ └── profile_common_pb2.py │ ├── abtesting │ │ └── v1 │ │ │ ├── ab_testing_shared_pb2.py │ │ │ └── ab_service_pb2.py │ ├── chats │ │ └── v2 │ │ │ ├── chats_common_pb2.py │ │ │ └── chat_info_service_pb2.py │ ├── persona │ │ └── v2 │ │ │ └── persona_service_pb2.py │ ├── badgecount │ │ └── v1 │ │ │ └── badge_count_service_pb2.py │ ├── protobuf_validation_pb2.py │ ├── push │ │ └── v2 │ │ │ └── push_common_pb2.py │ ├── client │ │ └── v2 │ │ │ └── client_meta_pb2.py │ ├── common_rpc_pb2.py │ ├── video │ │ └── v1 │ │ │ └── kik_video_service_pb2.py │ ├── messaging │ │ └── v2 │ │ │ └── model_pb2.py │ └── antispam │ │ └── safetynet │ │ └── v1 │ │ └── safetynet_service_pb2.py ├── configuration │ └── __init__.py └── device_configuration.py ├── pyproject.toml ├── .flake8 ├── setup.cfg ├── .dockerignore ├── docker-compose.yml ├── examples ├── creds.yaml ├── legacy │ ├── send_message_legacy.py │ └── echo_bot_legacy.py ├── generate_credentials_file.py ├── simple_echo_bot.py ├── register_client.py └── send_acks.py ├── Dockerfile ├── requirements.txt ├── .env.example ├── LICENSE ├── .gitignore └── setup.py /kik_unofficial/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/parser/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/datatypes/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/datatypes/xmpp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/http_requests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/groups/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/accounts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/accounts/v1/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/common/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/entity/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/groups/v1/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/groups/v2/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/common/v1/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/entity/v1/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line-length = 160 3 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 160 3 | extend-exclude = kik_unofficial/protobuf/* 4 | 5 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.rst 3 | 4 | [bdist_wheel] 5 | python-tag = py3 6 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # IntelliJ project files 2 | .idea 3 | *.iml 4 | 5 | # Distribution / packaging 6 | build/ 7 | lib/ 8 | *.egg-info/ 9 | 10 | # Environments 11 | venv/ 12 | .env* 13 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | bot: 4 | build: . 5 | env_file: 6 | - .env 7 | container_name: kik-bot-api-unofficial 8 | tty: true 9 | stdin_open: true -------------------------------------------------------------------------------- /examples/creds.yaml: -------------------------------------------------------------------------------- 1 | # Auto-generated by ./generate_credentials_file.py 2 | username: my.username 3 | node: my.username_pqy 4 | password: mYpAsSw0rD 5 | device_id: dddddddddddddddddddddddddddddddd 6 | android_id: aaaaaaaaaaaaaaaa 7 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8 2 | 3 | LABEL name="kik-bot-api-unofficial" 4 | 5 | WORKDIR /app 6 | 7 | COPY setup* /app/ 8 | 9 | RUN pip install /app 10 | 11 | COPY . /app 12 | COPY examples/echo_bot.py /app/bot.py 13 | 14 | CMD python bot.py 15 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | setuptools~=68.2.0 2 | requests~=2.31.0 3 | bs4~=0.0.1 4 | beautifulsoup4~=4.12.2 5 | rsa~=4.9 6 | Pillow~=10.0.1 7 | pyDes~=2.0.1 8 | colorama~=0.4.6 9 | pbkdf2~=1.3 10 | python-dotenv~=1.0.0 11 | PyYAML~=6.0.1 12 | defusedxml~=0.7.1 13 | lxml~=4.9.3 -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # Copy this file to .env and fill in the values 2 | # DO NOT COMMIT .env TO GIT 3 | # NOTE: Don't use quotes around values. Quotes will break the script. 4 | 5 | DEVICE_ID=62030843678b7376a707ca3d11e87836 6 | ANDROID_ID=849d4ffb0c020de6 7 | 8 | BOT_USERNAME=bot_username 9 | BOT_PASSWORD=bot_password 10 | BOT_NODE_JID=bot_node_jid 11 | -------------------------------------------------------------------------------- /kik_unofficial/utilities/xml_utilities.py: -------------------------------------------------------------------------------- 1 | from lxml import etree 2 | 3 | 4 | def encode_etree(element_or_tree) -> bytes: 5 | """ 6 | Encodes a xml tag to a stanza for serialization to Kik. 7 | """ 8 | xml = etree.tostring(element_or_tree, xml_declaration=None, encoding="utf-8", pretty_print=False, method="xml") 9 | xml = xml.replace(b'"/>', b'" />') # Simulates KXmlSerializer behavior in Java / Android 10 | return xml 11 | -------------------------------------------------------------------------------- /kik_unofficial/configuration/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from dotenv import dotenv_values 4 | 5 | __all__ = ["env"] 6 | 7 | # Get the path of the current file, so we can import our .env 8 | # configuration from other scripts, regardless of 9 | # working directory during execution. 10 | __dir_path = os.path.dirname(os.path.realpath(__file__)) 11 | 12 | # Load the .env file 13 | env = {**os.environ, **dotenv_values(f"{__dir_path}/../../.env")} 14 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/feature_payment.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.messagepath.v1; 4 | 5 | option java_package = "com.kik.messagepath.model"; 6 | option objc_class_prefix = "KPB"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 8 | 9 | import "protobuf_validation.proto"; 10 | 11 | // TransactionDetailsAttachment is meant to be attached to status messages related to feature payments 12 | // It contains the intended target of the status message 13 | message TransactionDetailsAttachment { 14 | 15 | Target target = 1; 16 | enum Target { 17 | UNKNOWN = 0; 18 | SENDER = 1; 19 | RECIPIENT = 2; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/text_markdown.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.messagepath.v1; 4 | 5 | option java_package = "com.kik.messagepath.model"; 6 | option objc_class_prefix = "MPTH"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 8 | 9 | import "protobuf_validation.proto"; 10 | 11 | // TextMarkdownAttachment defines the mechanism that allows bots to send a text message containing 12 | // text with markdown. 13 | // 14 | // This attachment should be used by the client to render text with markdown. 15 | message TextMarkdownAttachment { 16 | string markdown = 1 [(kik.validation.field_validation) = { 17 | max_byte_length: 2500 18 | }]; 19 | } 20 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/chat_theme.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.messagepath.v1; 4 | 5 | option java_package = "com.kik.messagepath.model"; 6 | option objc_class_prefix = "KPB"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 8 | 9 | import "protobuf_validation.proto"; 10 | import "entity/v1/element_common.proto"; 11 | 12 | // ChatThemeAttachment defines any updates about chat themes. 13 | // 14 | // If this attachment is sent, then the client can assume that the chat theme has changed. 15 | message ChatThemeAttachment { 16 | common.entity.v1.ChatThemeElement new_chat_theme = 1; 17 | 18 | common.entity.v1.ChatThemeLockElement new_chat_theme_lock = 2; 19 | } 20 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/compile_protobuf.sh: -------------------------------------------------------------------------------- 1 | : ' 2 | This bash script is used to compile all of the .proto files of kik into python (using `protoc`), as you can see in the protobuf/ directory. 3 | It also fixes python package names to generate correct directory structure for this project. 4 | ' 5 | 6 | #!/bin/bash 7 | set -e 8 | files=$(find protobuf_source -name '*.proto') 9 | protoc -I protobuf_source $files --python_out=kik_unofficial/protobuf 10 | generated_files=$(find kik_unofficial/protobuf -name '*_pb2.py') 11 | echo $generated_files 12 | sed -i 's/^import \([^ ]*\)_pb2 as \([^ ]*\)$/import kik_unofficial.protobuf.\1_pb2 as \2/' $generated_files 13 | sed -i 's/^from \([^ ]*\) import \([^ ]*\)_pb2 as \([^ ]*\)$/from kik_unofficial.protobuf.\1 import \2_pb2 as \3/' $generated_files 14 | echo Done. 15 | -------------------------------------------------------------------------------- /kik_unofficial/utilities/kik_server_clock.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | 4 | class KikServerClock: 5 | """ 6 | Keeps track of the client to server timestamp offset. 7 | 8 | This should be used when sending stanzas that contain timestamps. 9 | """ 10 | 11 | _server_time_offset = 0 # type: int 12 | 13 | @staticmethod 14 | def get_server_time() -> int: 15 | return KikServerClock.get_system_time() + KikServerClock._server_time_offset 16 | 17 | @staticmethod 18 | def recalculate_offset(kik_time: int) -> int: 19 | if kik_time > 0: 20 | KikServerClock._server_time_offset = kik_time - KikServerClock.get_system_time() 21 | return KikServerClock._server_time_offset 22 | 23 | @staticmethod 24 | def get_system_time() -> int: 25 | return int(round(time.time() * 1000)) 26 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/README.md: -------------------------------------------------------------------------------- 1 | # Kik Messenger Protobuf API # 2 | [Protocol Buffers](https://developers.google.com/protocol-buffers/) in kik are used for a variety of purposes, for example [searching for groups](https://github.com/tomer8007/kik-bot-api-unofficial/blob/new/kik_unofficial/datatypes/xmpp/roster.py#L127). 3 | Usually you can identify protobuf services if the `xmlns` field starts with `kik:iq:xiphias:`. 4 | 5 | This directory contains most of kik's protobuf datatypes in both source (`.proto` files) and compiled python versions. 6 | 7 | 8 | ## Organization ## 9 | The source files are stored in the `probuf_source` directory. Other directories contain the auto-generated python classes. 10 | 11 | An additional bash script `compile_protobuf.sh` in this directory is provided to automatically compile new extracted `.proto` files from the Android `apk` file. 12 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/groups/v2/groups_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.groups.v2; 4 | 5 | option java_package = "com.kik.gen.groups.v2"; 6 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/groups/v2;groups"; 7 | option objc_class_prefix = "KPBCommonGroupsV2"; 8 | 9 | import "protobuf_validation.proto"; 10 | 11 | // Fields necessary for public groups. 12 | message PublicGroupFields { 13 | // Group hashtag which uniquely identifies a group. Used for group search. 14 | Hashtag hashtag = 1 [(kik.validation.field_validation) = { 15 | mandatory: true 16 | }]; 17 | } 18 | 19 | // Hashtag must contain '#' plus 2 to 32 more characters. 20 | message Hashtag { 21 | string hashtag = 1 [(kik.validation.field_validation) = { 22 | mandatory: true 23 | regex: "^#[\\w\\.]{2,32}$" 24 | }]; 25 | } 26 | -------------------------------------------------------------------------------- /kik_unofficial/http_requests/tenor_client.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import requests 4 | 5 | 6 | class KikTenorClient: 7 | def __init__(self, api_key: str): 8 | if not api_key: 9 | raise Exception("A tenor.com API key is required to search for GIFs") 10 | self.headers = {"X-Goog-Api-Key": api_key} 11 | 12 | def search_for_gif(self, search_term: str) -> tuple[bytes, dict]: 13 | params = {"q": search_term, "limit": "1"} 14 | r = requests.get("https://tenor.googleapis.com/v2/search", params=params, headers=self.headers) 15 | r.raise_for_status() 16 | 17 | gif = r.json()["results"][0] 18 | media_formats = gif["media_formats"] 19 | 20 | thumbnail_url = media_formats["nanogifpreview"]["url"] 21 | thumbnail_bytes = requests.get(thumbnail_url).content 22 | 23 | return thumbnail_bytes, media_formats 24 | -------------------------------------------------------------------------------- /examples/legacy/send_message_legacy.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import time 3 | 4 | from kik_unofficial.client_legacy import KikClient 5 | 6 | 7 | def main(): 8 | username, password = "your_username", "password" 9 | kik_client = KikClient(username, password) 10 | 11 | chat_partners = kik_client.get_chat_partners() 12 | print("[+] Chats\n{}".format("\n".join([peer['jid'] for peer in chat_partners.values()]))) 13 | 14 | # let's talk 15 | username = "other_username" 16 | kik_client.send_is_typing(username, "true") 17 | time.sleep(0.5) 18 | kik_client.send_is_typing(username, "false") 19 | kik_client.send_message(username, "hi from bot!") 20 | 21 | print("[+] Done!") 22 | kik_client.close() 23 | 24 | 25 | if __name__ == '__main__': 26 | if sys.version_info[0] < 3: 27 | raise Exception("Must be using Python 3!!") 28 | try: 29 | main() 30 | except KeyboardInterrupt: 31 | print("[!] User stopped execution.") 32 | -------------------------------------------------------------------------------- /kik_unofficial/utilities/credential_utilities.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | from kik_unofficial.configuration import env 5 | from typing import Tuple, Union 6 | 7 | 8 | def random_device_id(): 9 | return os.urandom(16).hex() 10 | 11 | 12 | def random_android_id(): 13 | return os.urandom(8).hex() 14 | 15 | 16 | def get_credentials_from_env_or_prompt() -> Union[Tuple[str, str, str], None]: 17 | # /// ENVIRONMENT VARIABLES /// # 18 | # Create your own `.env` file to store the environment variables if running with Docker. 19 | # See `.env.example` for an example. You can also just set the environment variables manually. 20 | username = env.get("BOT_USERNAME", None) 21 | password = env.get("BOT_PASSWORD", None) 22 | node = env.get("BOT_NODE_JID", None) 23 | 24 | if not username: 25 | username = sys.argv[1] if len(sys.argv) > 1 else input("Username: ") 26 | 27 | if not password: 28 | password = sys.argv[2] if len(sys.argv) > 2 else input("Password: ") 29 | 30 | if not node: 31 | node = None 32 | 33 | return username, password, node 34 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/session/v2/model.proto: -------------------------------------------------------------------------------- 1 | // EXPERIMENTAL: The definitions here are experimental and subject to change at 2 | // any moment. They are pulled in from the kikx branch, which should be used as 3 | // the source of truth for any Kikx work. These appear in master to unblock work 4 | // on legacy systems. 5 | 6 | syntax = "proto3"; 7 | 8 | package common.session.v2; 9 | 10 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/session/v2;session"; 11 | option java_package = "com.kik.gen.session.v2"; 12 | option objc_class_prefix = "KPBCommonSessionV2"; 13 | 14 | import "google/protobuf/timestamp.proto"; 15 | 16 | // SessionToken is a globally unique token used to authenticate requests within 17 | // a user's session. 18 | message SessionToken { 19 | Token token = 1; 20 | message Token { 21 | bytes raw_value = 1; 22 | } 23 | 24 | // The UTC timestamp when the token expire and becomes invalid. Server 25 | // reserves the right to invalidate session tokens at any point in time. 26 | google.protobuf.Timestamp expiry = 2; 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Tomer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /kik_unofficial/utilities/threading_utils.py: -------------------------------------------------------------------------------- 1 | import threading 2 | 3 | 4 | def run_in_new_thread(fn): 5 | def run(*k, **kw): 6 | t = threading.Thread(target=fn, args=k, kwargs=kw) 7 | t.start() 8 | return t 9 | 10 | run.thread_decorated = True 11 | return run 12 | 13 | 14 | """ 15 | class RunInNewThreadDecorate(type): 16 | def __new__(mcls, name, bases, attrs): 17 | if name.startswith('None'): 18 | return None 19 | 20 | newattrs = attrs 21 | if len(bases) > 0: 22 | base_class = bases[0] 23 | # Go over attributes and see if they should be renamed. 24 | for attrname, attrvalue in attrs.items(): 25 | if attrname in dir(base_class): 26 | original_method = getattr(base_class, attrname) 27 | if hasattr(original_method, 'thread_decorated'): 28 | newattrs[attrname] = run_in_new_thread(attrvalue) 29 | else: 30 | newattrs[attrname] = attrvalue 31 | 32 | return super(RunInNewThreadDecorate, mcls).__new__(mcls, name, bases, newattrs) 33 | """ 34 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/bridgetest/v1/disabled_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: bridgetest/v1/disabled_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_rpc_pb2 as common__rpc__pb2 15 | import kik_unofficial.protobuf.bridgetest.v1_pb2 as bridgetest_common 16 | 17 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 18 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'bridgetest.v1.disabled_service_pb2', globals()) 19 | if _descriptor._USE_C_DESCRIPTORS == False: 20 | 21 | DESCRIPTOR._options = None 22 | DESCRIPTOR._serialized_options = b'\n\022com.kik.bridgetestZRgithub.com/kikinteractive/xiphias-api-mobile/generated/go/bridgetest/v1;bridgetest' 23 | _DISABLED._serialized_start=120 24 | _DISABLED._serialized_end=448 25 | # @@protoc_insertion_point(module_scope) 26 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/bridgetest/v1/authenticated_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.bridgetest.v1; 4 | option java_package = "com.kik.bridgetest"; 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/bridgetest/v1;bridgetest"; 6 | 7 | import "common_rpc.proto"; 8 | import "bridgetest/v1/bridgetest_common.proto"; 9 | 10 | //---------------------------------------------------------------------------- 11 | // Service Interfaces 12 | //---------------------------------------------------------------------------- 13 | 14 | // A service that expects requestors to be authenticated 15 | service Authenticated { 16 | // Send a message; the same message is sent back 17 | rpc Echo(common.bridgetest.v1.EchoRequest) returns (common.bridgetest.v1.EchoResponse); 18 | 19 | // Wait a specified amount of time (ms) before responding 20 | rpc Workout(common.bridgetest.v1.WorkoutRequest) returns (common.VoidResponse); 21 | 22 | // Throws an exception 23 | rpc Exception(common.VoidRequest) returns (common.VoidResponse); 24 | 25 | // Validates bridge headers 26 | rpc ValidateHeaders(common.bridgetest.v1.ValidateHeadersRequest) returns (common.bridgetest.v1.ValidateHeadersResponse); 27 | } 28 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/bridgetest/v1/preregistration_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.bridgetest.v1; 4 | option java_package = "com.kik.bridgetest"; 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/bridgetest/v1;bridgetest"; 6 | 7 | import "common_rpc.proto"; 8 | import "bridgetest/v1/bridgetest_common.proto"; 9 | 10 | //---------------------------------------------------------------------------- 11 | // Service Interfaces 12 | //---------------------------------------------------------------------------- 13 | 14 | // A service that does not require requestors to be authenticated 15 | service PreRegistration { 16 | // Send a message; the same message is sent back 17 | rpc Echo(common.bridgetest.v1.EchoRequest) returns (common.bridgetest.v1.EchoResponse); 18 | 19 | // Wait a specified amount of time (ms) before responding 20 | rpc Workout(common.bridgetest.v1.WorkoutRequest) returns (common.VoidResponse); 21 | 22 | // Throws an exception 23 | rpc Exception(common.VoidRequest) returns (common.VoidResponse); 24 | 25 | // Validates bridge headers 26 | rpc ValidateHeaders(common.bridgetest.v1.ValidateHeadersRequest) returns (common.bridgetest.v1.ValidateHeadersResponse); 27 | } 28 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/bridgetest/v1/authenticated_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: bridgetest/v1/authenticated_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_rpc_pb2 as common__rpc__pb2 15 | import kik_unofficial.protobuf.bridgetest.v1_pb2 as bridgetest_common 16 | 17 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 18 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'bridgetest.v1.authenticated_service_pb2', globals()) 19 | if _descriptor._USE_C_DESCRIPTORS == False: 20 | 21 | DESCRIPTOR._options = None 22 | DESCRIPTOR._serialized_options = b'\n\022com.kik.bridgetestZRgithub.com/kikinteractive/xiphias-api-mobile/generated/go/bridgetest/v1;bridgetest' 23 | _AUTHENTICATED._serialized_start=125 24 | _AUTHENTICATED._serialized_end=458 25 | # @@protoc_insertion_point(module_scope) 26 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/push/v2/push_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.push.v2; 4 | 5 | option java_package = "com.kik.gen.push.v2"; 6 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/push/v2;push"; 7 | option objc_class_prefix = "KPBCommonPushV2"; 8 | 9 | import "protobuf_validation.proto"; 10 | 11 | message PushToken { 12 | oneof kind { 13 | AndroidPushToken android_push_token = 1; 14 | IosPushToken ios_push_token = 2; 15 | } 16 | 17 | message AndroidPushToken { 18 | string token = 1 [(kik.validation.field_validation) = { 19 | mandatory: true 20 | max_byte_length: 1024 21 | }]; 22 | } 23 | 24 | message IosPushToken { 25 | 26 | // iOS systems returns this token to us in bytes, so we'll encode it in a URL-safe base64 string. 27 | string token = 1 [(kik.validation.field_validation) = { 28 | mandatory: true 29 | max_byte_length: 1024 30 | }]; 31 | 32 | Type type = 2; 33 | enum Type { 34 | APPSTORE_PRODUCTION = 0; 35 | APPSTORE_SANDBOX = 1; 36 | ENTERPRISE_PRODUCTION = 2; 37 | ENTERPRISE_SANDBOX = 3; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/bridgetest/v1/preregistration_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: bridgetest/v1/preregistration_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_rpc_pb2 as common__rpc__pb2 15 | import kik_unofficial.protobuf.bridgetest.v1_pb2 as bridgetest_common 16 | 17 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 18 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'bridgetest.v1.preregistration_service_pb2', globals()) 19 | if _descriptor._USE_C_DESCRIPTORS == False: 20 | 21 | DESCRIPTOR._options = None 22 | DESCRIPTOR._serialized_options = b'\n\022com.kik.bridgetestZRgithub.com/kikinteractive/xiphias-api-mobile/generated/go/bridgetest/v1;bridgetest' 23 | _PREREGISTRATION._serialized_start=127 24 | _PREREGISTRATION._serialized_end=462 25 | # @@protoc_insertion_point(module_scope) 26 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/chat_theme_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/chat_theme.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.entity.v1_pb2 as element_common 16 | 17 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 18 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.chat_theme_pb2', globals()) 19 | if _descriptor._USE_C_DESCRIPTORS == False: 20 | 21 | DESCRIPTOR._options = None 22 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\003KPB' 23 | _CHATTHEMEATTACHMENT._serialized_start=118 24 | _CHATTHEMEATTACHMENT._serialized_end=268 25 | # @@protoc_insertion_point(module_scope) 26 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/kin/payment/v1/payment_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.kin.payment.v1; 4 | 5 | option java_package = "com.kik.kin.payment.model"; 6 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/kin/payment/v1;payment"; 7 | 8 | import "protobuf_validation.proto"; 9 | import "common_model.proto"; 10 | 11 | // Contains information related to a specific payment 12 | message PaymentInfo { 13 | // The feature a payment is associated with 14 | Feature feature = 1; 15 | 16 | FeatureData feature_data = 2; 17 | 18 | // The amount of Kin in this payment. No min/max values are set because the size of Kin payments in the long term 19 | // aren't defined. 20 | KinAmount kin_amount = 3 [(kik.validation.field_validation) = { 21 | mandatory: true 22 | }]; 23 | } 24 | 25 | enum Feature { 26 | UNKNOWN = 0; 27 | PUBLIC_GROUP_ADMIN_TIP = 1; 28 | } 29 | 30 | message FeatureData { 31 | oneof kind { 32 | PublicGroupAdminTipData public_group_admin_tip_data = 1; 33 | } 34 | } 35 | 36 | message PublicGroupAdminTipData { 37 | common.XiGroupJid group = 1 [(kik.validation.field_validation) = {mandatory : true}]; 38 | } 39 | 40 | message KinAmount { 41 | double amount = 1; 42 | } 43 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/kik_options.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; // Need proto2 for custom options 2 | 3 | package kik; 4 | option java_package = "com.kik.options"; 5 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/kikoptions;kikoptions"; 6 | 7 | import "google/protobuf/descriptor.proto"; 8 | 9 | // 10 | // TODO: Potentially move all options here (including protobuf validation field options, etc) 11 | // 12 | 13 | extend google.protobuf.FileOptions { 14 | optional CheckStyleOptions checkstyle = 86581; 15 | } 16 | 17 | // 18 | // These options allow files to be exempt from specific checkstyle rules. 19 | // They should only be used in extreme circumstances, 20 | // when the proto file cannot or should not follow checkstyle conventions 21 | // 22 | message CheckStyleOptions { 23 | // Exempts file from having a directory path that matches the package name of a proto file 24 | optional bool ignore_path = 1 [default = false]; 25 | 26 | // Exempts file from having a version for the proto file 27 | optional bool ignore_version = 2 [default = false]; 28 | 29 | // Exempts file from having the package prefix of its package (such as common, mobile, internal, etc) 30 | optional bool ignore_package_prefix = 3 [default = false]; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/profile/v2/profile_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.profile.v2; 4 | 5 | option java_package = "com.kik.gen.profile.v2"; 6 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/profile/v2;profile"; 7 | option objc_class_prefix = "KPBCommonProfileV2"; 8 | 9 | import "protobuf_validation.proto"; 10 | 11 | // DisplayNameComponents are the components that make up a user's display name. 12 | // 13 | // The display name can be generated by concat(first_name, " ", last_name), 14 | // The display name components can be derived from a display name by splitting 15 | // on the first space. 16 | // 17 | // Spaces are allowed in the first and last name components, but this can cause 18 | // issues due to the way the components are derived from a display name 19 | // (i.e. split on the first space). 20 | message DisplayNameComponents { 21 | string first_name = 1 [(kik.validation.field_validation) = { 22 | mandatory: true 23 | max_byte_length: 255 24 | }]; 25 | 26 | string last_name = 2 [(kik.validation.field_validation) = { 27 | // Last name is optional to allow cases where we only 28 | // want a single name. An example use cases is bots. 29 | max_byte_length: 255 30 | }]; 31 | } 32 | -------------------------------------------------------------------------------- /kik_unofficial/device_configuration.py: -------------------------------------------------------------------------------- 1 | """ 2 | Here we put all the device configuration that we emulate. 3 | """ 4 | 5 | # possible kik versions to emulate 6 | # note that downgrading causes authentication to be lost 7 | kik_version_11_info = {"kik_version": "11.1.1.12218", "classes_dex_sha1_digest": "aCDhFLsmALSyhwi007tvowZkUd0="} 8 | kik_version_13_info = {"kik_version": "13.4.0.9614", "classes_dex_sha1_digest": "ETo70PFW30/jeFMKKY+CNanX2Fg="} 9 | kik_version_14_info = {"kik_version": "14.0.0.11130", "classes_dex_sha1_digest": "9nPRnohIOTbby7wU1+IVDqDmQiQ="} 10 | kik_version_14_5_info = {"kik_version": "14.5.0.13136", "classes_dex_sha1_digest": "LuYEjtvBu4mG2kBBG0wA3Ki1PSE="} 11 | kik_version_15_21_info = {"kik_version": "15.21.0.22201", "classes_dex_sha1_digest": "MbZ+Zbjaz5uFXKFDM88CwFh7DAg="} 12 | kik_version_15_49_info = {"kik_version": "15.49.0.27501", "classes_dex_sha1_digest": "5o61frOsakJJ2iCYafCoKHtyu7w="} 13 | kik_version_15_57_info = {"kik_version": "15.57.2.29235", "classes_dex_sha1_digest": "hA77Y2jUTVbpHRB9LosnnunQ1PY="} 14 | kik_version_15_60_info = {"kik_version": "15.60.1.29587", "classes_dex_sha1_digest": "FXxvP2QjSj+sXp+G1MqDdxz8Z51YjtqzFOQ7wlex0VM="} 15 | kik_version_17_0_info = {"kik_version": "17.0.0.31357", "classes_dex_sha1_digest": "Rm2No4v27p+pIF4DVwXJvXVvdds="} 16 | 17 | kik_version_info = kik_version_17_0_info 18 | -------------------------------------------------------------------------------- /examples/generate_credentials_file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import yaml 5 | import os 6 | import sys 7 | 8 | from kik_unofficial.utilities.credential_utilities import random_device_id, random_android_id 9 | 10 | 11 | def main(): 12 | parser = argparse.ArgumentParser() 13 | parser.add_argument("-o", "--output", default="creds.yaml", help="Name of output credentials file") 14 | parser.add_argument("-u", "--username", required=True, help="Kik username") 15 | parser.add_argument("-p", "--password", help="Kik password (optional)") 16 | parser.add_argument("-n", "--node", help="Kik node (optional)") 17 | args = parser.parse_args() 18 | 19 | if os.path.exists(args.output): 20 | raise Exception(f"Output file {args.output} already exists!") 21 | 22 | file_obj = { 23 | "device_id": random_device_id(), 24 | "android_id": random_android_id(), 25 | "username": args.username, 26 | } 27 | if args.password: 28 | file_obj["password"] = args.password 29 | if args.node: 30 | file_obj["node"] = args.node 31 | with open(args.output, "w") as f: 32 | f.write(f"# Auto-generated by {sys.argv[0]}\n") 33 | yaml.dump(file_obj, f) 34 | print(f"Wrote credentials to {args.output}") 35 | 36 | 37 | if __name__ == "__main__": 38 | main() 39 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/core_message_options.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; // Need proto2 for custom options 2 | 3 | package common.messagepath.v1; 4 | option java_package = "com.kik.messagepath.model"; 5 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 6 | 7 | import "google/protobuf/descriptor.proto"; 8 | 9 | extend google.protobuf.FieldOptions { 10 | // This option is used to document and control what CoreMessage attachments (fields) can be set 11 | // based on where the message originates from. Currently (Oct 2016), this option should only be 12 | // used on top level CoreMessage fields (ie: checking is not done recursively) 13 | // 14 | // NOTE: protobuf_validation.proto contains the master list of extension numbers used at kik 15 | // 16 | optional CoreMessageOriginRestriction origin_restriction = 76251; 17 | } 18 | 19 | message CoreMessageOriginRestriction { 20 | // The list of origins which are not allowed to use the particular attachment when sending 21 | // messages 22 | repeated Origin deny = 1; 23 | 24 | enum Origin { 25 | // Native mobile clients connecting over XMPP 26 | MOBILE = 0; 27 | // Bot platform bots sending messages over the WebMessagingBridge (As of Oct 2016) 28 | BOT = 1; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/bridgetest/v1/disabled_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.bridgetest.v1; 4 | option java_package = "com.kik.bridgetest"; 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/bridgetest/v1;bridgetest"; 6 | 7 | import "common_rpc.proto"; 8 | import "bridgetest/v1/bridgetest_common.proto"; 9 | 10 | //---------------------------------------------------------------------------- 11 | // Service Interfaces 12 | //---------------------------------------------------------------------------- 13 | 14 | // It is expected that this service is purposely placed in the disabled list to be filtered by the Xiphias bridge. 15 | // Calls to any method within this service should result in a SERVICE_UNAVAILABLE error packet. 16 | service Disabled { 17 | // Send a message; the same message is sent back 18 | rpc Echo(common.bridgetest.v1.EchoRequest) returns (common.bridgetest.v1.EchoResponse); 19 | 20 | // Wait a specified amount of time (ms) before responding 21 | rpc Workout(common.bridgetest.v1.WorkoutRequest) returns (common.VoidResponse); 22 | 23 | // Throws an exception 24 | rpc Exception(common.VoidRequest) returns (common.VoidResponse); 25 | 26 | // Validates bridge headers 27 | rpc ValidateHeaders(common.bridgetest.v1.ValidateHeadersRequest) returns (common.bridgetest.v1.ValidateHeadersResponse); 28 | } 29 | -------------------------------------------------------------------------------- /kik_unofficial/datatypes/exceptions.py: -------------------------------------------------------------------------------- 1 | class KikErrorException(Exception): 2 | def __init__(self, xml_error, message=None): 3 | self.message = message 4 | self.xml_error = xml_error 5 | 6 | def __str__(self): 7 | return self.__repr__() 8 | 9 | def __repr__(self): 10 | if self.message is not None: 11 | return self.message 12 | elif "prettify" in dict(self.xml_error): 13 | error_string = self.xml_error.prettify() 14 | else: 15 | error_string = self.xml_error 16 | return "Kik error: \r\n" + error_string 17 | 18 | 19 | class KikCaptchaException(KikErrorException): 20 | def __init__(self, xml_error, message, captcha_url): 21 | super().__init__(xml_error, message) 22 | self.captcha_url = captcha_url 23 | 24 | 25 | class KikLoginException(KikErrorException): 26 | pass 27 | 28 | 29 | class KikApiException(Exception): 30 | pass 31 | 32 | 33 | class KikParsingException(Exception): 34 | pass 35 | 36 | 37 | class KikUploadError(Exception): 38 | def __init__(self, status_code, reason=None): 39 | self.status_code = status_code 40 | self.reason = reason 41 | 42 | def __str__(self): 43 | return self.__repr__() 44 | 45 | def __repr__(self): 46 | if self.reason is None: 47 | return self.status_code 48 | return f"[{self.status_code}] {self.reason}" 49 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/bridgetest/v1/bridgetest_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.bridgetest.v1; 4 | option java_package = "com.kik.bridgetest"; 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/bridgetest/v1;bridgetest"; 6 | option (.kik.checkstyle).ignore_package_prefix = true; 7 | 8 | import "protobuf_validation.proto"; 9 | import "google/protobuf/duration.proto"; 10 | import "common_model.proto"; 11 | import "common_rpc.proto"; 12 | import "kik_options.proto"; 13 | 14 | //---------------------------------------------------------------------------- 15 | // Common Bridge Test Request/Response Types 16 | //---------------------------------------------------------------------------- 17 | 18 | message EchoRequest { 19 | string message = 1 [(kik.validation.field_validation) = { max_byte_length: 100000 }]; 20 | } 21 | 22 | message EchoResponse { 23 | string message = 1 [(kik.validation.field_validation) = { max_byte_length: 100000 }]; 24 | } 25 | 26 | message WorkoutRequest { 27 | google.protobuf.Duration duration = 1 [(kik.validation.field_validation) = { mandatory: true }]; 28 | } 29 | 30 | message ValidateHeadersRequest { 31 | bool is_auth = 1; 32 | common.XiBareUserJid jid = 2; 33 | common.XiDeviceId device_id = 3; 34 | common.XiRequestId request_id = 4; 35 | } 36 | 37 | message ValidateHeadersResponse { 38 | bool is_valid = 1; 39 | } 40 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/matching/v1/matching_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: matching/v1/matching_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 16 | import kik_unofficial.protobuf.common.v1_pb2 as model 17 | 18 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 19 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'matching.v1.matching_common_pb2', globals()) 20 | if _descriptor._USE_C_DESCRIPTORS == False: 21 | 22 | DESCRIPTOR._options = None 23 | DESCRIPTOR._serialized_options = b'\n\026com.kik.matching.modelZPgithub.com/kikinteractive/xiphias-model-common/generated/go/matching/v1;matching\240\001\001\242\002\003MAT' 24 | _CHATSESSIONSTATE._serialized_start=264 25 | _CHATSESSIONSTATE._serialized_end=312 26 | _ANONMATCHINGSESSIONKEY._serialized_start=128 27 | _ANONMATCHINGSESSIONKEY._serialized_end=262 28 | # @@protoc_insertion_point(module_scope) 29 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/chats/v2/chats_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.chats.v2; 4 | 5 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/chats/v2;chats"; 6 | option java_package = "com.kik.gen.chats.v2"; 7 | option objc_class_prefix = "KPBCommonChatsV2"; 8 | 9 | import "common/v2/model.proto"; 10 | import "protobuf_validation.proto"; 11 | import "google/protobuf/timestamp.proto"; 12 | 13 | // Theme id of a chat. Chats like OneToOne and Group chats can have chat themes which are products 14 | // that customize the user's chat experience. 15 | message ChatThemeId { 16 | // Id of the chat theme product to be displayed. 17 | // Chat theme assets are fetched from the product data service using this product id. 18 | common.v2.Uuid id = 1 [(kik.validation.field_validation) = { 19 | mandatory: true 20 | }]; 21 | } 22 | 23 | // Mute status of a chat from the perspective of the caller. 24 | message MuteStatus { 25 | Status status = 1; 26 | enum Status { 27 | NOT_MUTED = 0; 28 | MUTED = 1; 29 | } 30 | 31 | // Optional expiry time of the mute. 32 | // If status == MUTED and this is set, then this mute status will expire 33 | // on the value of this field and status will automatically change to NOT_MUTED. 34 | // If status == MUTED and this is _not_ set, then this mute will not expire until 35 | // the mute status is explicitly set to NOT_MUTED. 36 | google.protobuf.Timestamp expiry = 2; 37 | } 38 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/abtesting/v1/ab_testing_shared.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.abtesting.v1; 4 | option java_package = "com.kik.abtesting.rpc"; 5 | option objc_class_prefix = "XIAB"; 6 | 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/abtesting/v1;abtesting"; 8 | 9 | import "protobuf_validation.proto"; 10 | 11 | //************************************************************************************************* 12 | // A/B Testing identifiers 13 | //************************************************************************************************* 14 | message Experiment { 15 | // The name of the of the AB test 16 | string name = 1 [(kik.validation.field_validation) = { 17 | mandatory: true 18 | min_byte_length: 1 19 | max_byte_length: 255 20 | }]; 21 | 22 | // Variant of AB test the particular user is associated with 23 | string variant = 2 [(kik.validation.field_validation) = { 24 | mandatory: true 25 | min_byte_length: 1 26 | max_byte_length: 255 27 | }]; 28 | 29 | // An id that may be used to distinguish multiple runs of the same experiment. 30 | // Clients ** MUST NOT ** use this for any business-switching behaviour, this is ** ONLY ** meant to be 31 | // transitively passed on in the client metric for data purposes. 32 | string experiment_id = 3 [(kik.validation.field_validation) = { 33 | mandatory: false 34 | min_byte_length: 0 35 | max_byte_length: 255 36 | }]; 37 | } 38 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/mentions.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.messagepath.v1; 4 | 5 | option java_package = "com.kik.messagepath.model"; 6 | option objc_class_prefix = "MPTH"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 8 | 9 | import "common_model.proto"; 10 | import "common/v1/model.proto"; 11 | import "protobuf_validation.proto"; 12 | 13 | // For mention replies (from bots to users), this attachment is used to indicate the user who 14 | // originally mentioned the bot. 15 | // 16 | // See https://github.com/kikinteractive/kik-product/wiki/Bot-Mentions 17 | // 18 | // This should only be used the client for internal logic specific to mention-reply messages 19 | // (e.g. on iPhone 10.9 it is used to determine whether to show the "Reply" button) 20 | // DO NOT use this attachment to determine visibility rules (use the visibility_rules_attachment for that). 21 | message MentionReplyAttachment { 22 | // The original user who mentioned the bot. 23 | // Field is OPTIONAL but should be set when the mentioner is known. 24 | // TODO: To be removed after switching all consumers to original_mentioner_v2 25 | XiBareUserJid original_mentioner = 1 [(kik.validation.field_validation) = { 26 | mandatory: false 27 | }, deprecated = true]; 28 | 29 | // Version 2 will replace non-versioned. 30 | // The original_mentioner_v2 can be userJid or an aliased jid 31 | common.v1.XiBareUserJidOrAliasJid original_mentioner_v2 = 2; 32 | } 33 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/product/v1/product_data_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.product.v1; 4 | 5 | option java_package = "com.kik.product.model"; 6 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/product/v1;product"; 7 | 8 | import "protobuf_validation.proto"; 9 | import "common/v1/model.proto"; 10 | import "kin/authentication/v1/authentication_common.proto"; 11 | 12 | // Price data for a Kik product 13 | message PriceData { 14 | 15 | uint64 kin_value = 1; 16 | } 17 | 18 | // Purchase data contain info whether a product was previously purchased by a user 19 | message PurchaseData { 20 | 21 | bool purchased = 1; 22 | } 23 | 24 | // Payment confirmation contains offer Id (that has been purchased by the user on the Kin marketplace) and its JWT. 25 | // 26 | // Payment confirmations are generated by the Kin marketplace and used to unlock products for the user. The JWT is 27 | // authenticated by the authentication service that it was truly originated from the Kin marketplace 28 | // 29 | // Currently Product Id is supported as an offer Id. 30 | message PaymentConfirmation { 31 | 32 | // The id of an offer. An offer as an entity offered by Kik that has a Kin value and can be purchased. Currently, 33 | // product Ids are supported. 34 | common.kin.authentication.v1.OfferId offer_id = 1 [(kik.validation.field_validation) = { mandatory: true }]; 35 | 36 | // JWT of the offer. 37 | common.v1.XiJWT jwt = 2 [(kik.validation.field_validation) = { mandatory: true }]; 38 | } 39 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/matching/v1/matching_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.matching.v1; 4 | option java_package = "com.kik.matching.model"; 5 | option java_generate_equals_and_hash = true; 6 | option objc_class_prefix = "MAT"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/matching/v1;matching"; 8 | 9 | import "protobuf_validation.proto"; 10 | import "common_model.proto"; 11 | import "common/v1/model.proto"; 12 | 13 | //************************************************** 14 | // 15 | // Objects common to anonymous matching service, used by mobile and internal apis 16 | // 17 | //************************************************** 18 | 19 | message AnonMatchingSessionKey { 20 | // A session can be identified by the session id, or either of the ajids in the conversation 21 | // session_id is preferred wherever possible because it is less costly than retrieving by alias 22 | oneof chat_session_id { 23 | common.XiUuid session_id = 1; 24 | common.v1.XiAliasJid chat_partner_alias = 2; 25 | } 26 | } 27 | 28 | enum ChatSessionState { 29 | // Participants can chat, end chat, vote early 30 | CHAT_ACTIVE = 0; 31 | // Chatting with this session will fail, voting on friending can occur 32 | // *** VOTING NOT SUPPORTED YET *** 33 | // VOTING = 1; 34 | // Chatting and voting is closed, session is considered marked for cleanup at this state 35 | // If users end the chat early, chat sessions are transitioned to EXPIRY with no voting period 36 | EXPIRED = 2; 37 | } 38 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/kin/authentication/v1/authentication_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package mobile.kin.authentication.v1; 3 | 4 | option java_package = "com.kik.kin.authentication.rpc"; 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/kin/authentication/v1;authentication"; 6 | 7 | 8 | import "protobuf_validation.proto"; 9 | 10 | import "common_model.proto"; 11 | import "common/v1/model.proto"; 12 | 13 | //******************************************************************************** 14 | // Kin Authentication service 15 | // 16 | // The Kin authentication service is responsible for registering user so that they are able to access the Kin 17 | // marketplace. 18 | //******************************************************************************** 19 | 20 | service Authentication { 21 | 22 | rpc GenerateUserJwt(GenerateUserJwtRequest) returns (GenerateUserJwtResponse); 23 | } 24 | 25 | message GenerateUserJwtRequest { 26 | 27 | common.XiBareUserJid user_jid = 1 [(kik.validation.field_validation) = { mandatory: true }]; 28 | } 29 | 30 | message GenerateUserJwtResponse { 31 | 32 | Result result = 1; 33 | enum Result { 34 | OK = 0; 35 | REJECTED = 1; 36 | } 37 | 38 | UserJwtRejectionReason rejection_reason = 2; 39 | 40 | common.v1.XiJWT user_jwt = 3; 41 | } 42 | 43 | message UserJwtRejectionReason { 44 | 45 | Code code = 1; 46 | enum Code { 47 | UNKNOWN = 0; 48 | // User not authorized or whitelisted to use Kin marketplace 49 | REJECTED_USER_NOT_AUTHORIZED = 1; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/entity/v1/subscription_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.entity.v1; 4 | option java_package = "com.kik.entity.model"; 5 | option java_generate_equals_and_hash = true; 6 | option objc_class_prefix = "SUBS"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/entity/v1;entity"; 8 | 9 | import "protobuf_validation.proto"; 10 | import "entity/v1/entity_common.proto"; 11 | import "common/v1/model.proto"; 12 | 13 | //************************************************** 14 | // 15 | // Contains a dictionary of shared objects between 16 | // mobile and internal services 17 | // 18 | //************************************************** 19 | 20 | message RosterSyncToken{ 21 | // Clients MUST NOT interpret this message. 22 | bytes payload = 1 [(kik.validation.field_validation) = { 23 | mandatory: true 24 | min_byte_length: 1 25 | max_byte_length: 5120 }]; 26 | } 27 | 28 | // Pseudo-entity that indicates the given alias JID is blocked by the requesting user 29 | message AliasBlockEntry { 30 | common.v1.XiAliasJid alias_jid = 1 [(kik.validation.field_validation) = { mandatory: true }]; 31 | } 32 | 33 | message RosterEntry { 34 | // OneOf user or group 35 | oneof roster_entry_kind { 36 | common.entity.v1.EntityUserRosterEntry user_data = 1; 37 | common.entity.v1.EntityGroupRosterEntry group_data = 2; 38 | AliasBlockEntry alias_block_data = 4; 39 | } 40 | 41 | // Only applies to user rosters 42 | // Has this person being blocked by roster owner? 43 | bool is_blocked = 3; 44 | } 45 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/link_message.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.messagepath.v1; 4 | 5 | option java_package = "com.kik.messagepath.model"; 6 | option objc_class_prefix = "MPTH"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 8 | 9 | import "protobuf_validation.proto"; 10 | import "messagepath/v1/core_message_common.proto"; 11 | 12 | // LinkMessageAttachment defines the information required to render a link message sent by a bot. 13 | message LinkMessageAttachment { 14 | // Clients handle up to 10 URIs in a message. The URI of lowest priority is typically set as a 15 | // fallback page for old versions of iOS and Android that do not support the Kik browser. 16 | repeated UriElement uris = 1 [(kik.validation.field_validation) = { 17 | mandatory: true 18 | min_repetitions: 1 19 | max_repetitions: 10 20 | }]; 21 | 22 | // The title of the link message. 23 | string title = 50 [(kik.validation.field_validation) = { max_byte_length: 1000 }]; 24 | 25 | // The text of the link message. 26 | string text = 51 [(kik.validation.field_validation) = { max_byte_length: 2000 }]; 27 | 28 | // The picture to display in the link message. 29 | PictureElement picture = 52; 30 | 31 | // Describes the entity the link should be attributed to. 32 | AttributionAttachment attribution = 53; 33 | 34 | // Dictates which content layout should be used for this message. 35 | ContentLayoutElement content_layout = 54; 36 | 37 | // Dictates if the link message can be forwarded to another conversation or not. 38 | bool allow_forward = 55; 39 | } 40 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/mobile_video_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: mobile_video_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 16 | import kik_unofficial.protobuf.common_rpc_pb2 as common__rpc__pb2 17 | import kik_unofficial.protobuf.video.v1_pb2 as video_common 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'mobile_video_service_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\032com.kik.video.mobileremoteZNgithub.com/kikinteractive/xiphias-api-mobileremote/generated/go/video/v1;video' 25 | _ONCONVOVIDEOSTATECHANGEDNOTIFICATION.fields_by_name['notification_id']._options = None 26 | _ONCONVOVIDEOSTATECHANGEDNOTIFICATION.fields_by_name['notification_id']._serialized_options = b'\312\235%\0020$' 27 | _ONCONVOVIDEOSTATECHANGEDNOTIFICATION._serialized_start=148 28 | _ONCONVOVIDEOSTATECHANGEDNOTIFICATION._serialized_end=280 29 | _MOBILEVIDEO._serialized_start=282 30 | _MOBILEVIDEO._serialized_end=406 31 | # @@protoc_insertion_point(module_scope) 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | 103 | .idea 104 | -------------------------------------------------------------------------------- /examples/simple_echo_bot.py: -------------------------------------------------------------------------------- 1 | from kik_unofficial.client import KikClient 2 | from kik_unofficial.callbacks import KikClientCallback 3 | import kik_unofficial.datatypes.xmpp.chatting as chatting 4 | from kik_unofficial.datatypes.xmpp.errors import LoginError 5 | 6 | # Your kik login credentials (username and password) 7 | username = "your_kik_username" 8 | password = "your_kik_password" 9 | 10 | 11 | # This bot class handles all the callbacks from the kik client 12 | class EchoBot(KikClientCallback): 13 | def __init__(self): 14 | self.client = KikClient(self, username, password, enable_console_logging=True) 15 | self.client.wait_for_messages() 16 | 17 | # This method is called when the bot is fully logged in and setup 18 | def on_authenticated(self): 19 | self.client.request_roster() # request list of chat partners 20 | 21 | # This method is called when the bot receives a direct message (chat message) 22 | def on_chat_message_received(self, chat_message: chatting.IncomingChatMessage): 23 | self.client.send_chat_message(chat_message.from_jid, f'You said "{chat_message.body}"!') 24 | 25 | # This method is called when the bot receives a chat message in a group 26 | def on_group_message_received(self, chat_message: chatting.IncomingGroupChatMessage): 27 | self.client.send_chat_message(chat_message.group_jid, f'You said "{chat_message.body}"!') 28 | 29 | # This method is called if a captcha is required to login 30 | def on_login_error(self, login_error: LoginError): 31 | if login_error.is_captcha(): 32 | login_error.solve_captcha_wizard(self.client) 33 | 34 | 35 | if __name__ == '__main__': 36 | # Creates the bot and start listening for incoming chat messages 37 | callback = EchoBot() 38 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/kin/authentication/v1/authentication_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.kin.authentication.v1; 4 | 5 | option java_package = "com.kik.kin.authentication.model"; 6 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/kin/authentication/v1;authentication"; 7 | 8 | import "protobuf_validation.proto"; 9 | import "common_model.proto"; 10 | import "common/v1/model.proto"; 11 | 12 | // OfferId contains the id of any offer that's meant to be paid for on the Kin marketplace 13 | message OfferId { 14 | 15 | oneof value { 16 | // Uuid of a AMS product 17 | common.XiUuid product_id = 1; 18 | 19 | // The offer id of a feature - used for JWT generation and tracking in the Kin SDK. 20 | // The offer id should ideally be in the format 'FEATURE_ID-TIMESTAMP'. Timestamp is epoch time in milliseconds 21 | // This will help verify payment confirmation JWTs 22 | string feature_offer_id = 2 [(kik.validation.field_validation) = { 23 | min_byte_length: 1 24 | max_byte_length: 128 25 | }]; 26 | } 27 | } 28 | 29 | // An offer JWT is generated by the authentication service in response to a service requesting a JWT for a Kin offer. 30 | // Currently, the product data service is the main user of this JWT. 31 | message OfferJwt { 32 | 33 | // The id of an offer. An offer as an entity offered by Kik that has a Kin value and can be purchased. Currently, 34 | // product Ids are supported. 35 | OfferId id = 1 [(kik.validation.field_validation) = { mandatory: true }]; 36 | 37 | // JWT generated by the authentication service for an offer. 38 | common.v1.XiJWT jwt = 2 [(kik.validation.field_validation) = { mandatory: true }]; 39 | } 40 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/entity/v1/subscription_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: entity/v1/subscription_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.entity.v1_pb2 as subscription_common 16 | 17 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 18 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'entity.v1.subscription_service_pb2', globals()) 19 | if _descriptor._USE_C_DESCRIPTORS == False: 20 | 21 | DESCRIPTOR._options = None 22 | DESCRIPTOR._serialized_options = b'\n\"com.kik.entity.subscription.mobileZJgithub.com/kikinteractive/xiphias-api-mobile/generated/go/entity/v1;entity' 23 | _SYNCMYROSTERDATARESPONSE.fields_by_name['roster_data']._options = None 24 | _SYNCMYROSTERDATARESPONSE.fields_by_name['roster_data']._serialized_options = b'\312\235%\004\200\001\364\003' 25 | _SYNCMYROSTERDATAREQUEST._serialized_start=122 26 | _SYNCMYROSTERDATAREQUEST._serialized_end=197 27 | _SYNCMYROSTERDATARESPONSE._serialized_start=200 28 | _SYNCMYROSTERDATARESPONSE._serialized_end=471 29 | _SYNCMYROSTERDATARESPONSE_RESULT._serialized_start=425 30 | _SYNCMYROSTERDATARESPONSE_RESULT._serialized_end=471 31 | _SUBSCRIPTION._serialized_start=473 32 | _SUBSCRIPTION._serialized_end=594 33 | # @@protoc_insertion_point(module_scope) 34 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/kik_options_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: kik_options.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11kik_options.proto\x12\x03kik\x1a google/protobuf/descriptor.proto\"t\n\x11\x43heckStyleOptions\x12\x1a\n\x0bignore_path\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x1d\n\x0eignore_version\x18\x02 \x01(\x08:\x05\x66\x61lse\x12$\n\x15ignore_package_prefix\x18\x03 \x01(\x08:\x05\x66\x61lse:J\n\ncheckstyle\x12\x1c.google.protobuf.FileOptions\x18\xb5\xa4\x05 \x01(\x0b\x32\x16.kik.CheckStyleOptionsBd\n\x0f\x63om.kik.optionsZQgithub.com/kikinteractive/xiphias-model-common/generated/go/kikoptions;kikoptions') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kik_options_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(checkstyle) 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\017com.kik.optionsZQgithub.com/kikinteractive/xiphias-model-common/generated/go/kikoptions;kikoptions' 26 | _CHECKSTYLEOPTIONS._serialized_start=60 27 | _CHECKSTYLEOPTIONS._serialized_end=176 28 | # @@protoc_insertion_point(module_scope) 29 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/link_message_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/link_message.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.messagepath.v1_pb2 as core_message_common 16 | 17 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 18 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.link_message_pb2', globals()) 19 | if _descriptor._USE_C_DESCRIPTORS == False: 20 | 21 | DESCRIPTOR._options = None 22 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\004MPTH' 23 | _LINKMESSAGEATTACHMENT.fields_by_name['uris']._options = None 24 | _LINKMESSAGEATTACHMENT.fields_by_name['uris']._serialized_options = b'\312\235%\007\010\001x\001\200\001\n' 25 | _LINKMESSAGEATTACHMENT.fields_by_name['title']._options = None 26 | _LINKMESSAGEATTACHMENT.fields_by_name['title']._serialized_options = b'\312\235%\0030\350\007' 27 | _LINKMESSAGEATTACHMENT.fields_by_name['text']._options = None 28 | _LINKMESSAGEATTACHMENT.fields_by_name['text']._serialized_options = b'\312\235%\0030\320\017' 29 | _LINKMESSAGEATTACHMENT._serialized_start=130 30 | _LINKMESSAGEATTACHMENT._serialized_end=477 31 | # @@protoc_insertion_point(module_scope) 32 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/session/v2/model_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: session/v2/model.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16session/v2/model.proto\x12\x11\x63ommon.session.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8c\x01\n\x0cSessionToken\x12\x34\n\x05token\x18\x01 \x01(\x0b\x32%.common.session.v2.SessionToken.Token\x12*\n\x06\x65xpiry\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1a\n\x05Token\x12\x11\n\traw_value\x18\x01 \x01(\x0c\x42}\n\x16\x63om.kik.gen.session.v2ZNgithub.com/kikinteractive/xiphias-model-common/generated/go/session/v2;session\xa2\x02\x12KPBCommonSessionV2b\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'session.v2.model_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\026com.kik.gen.session.v2ZNgithub.com/kikinteractive/xiphias-model-common/generated/go/session/v2;session\242\002\022KPBCommonSessionV2' 25 | _SESSIONTOKEN._serialized_start=79 26 | _SESSIONTOKEN._serialized_end=219 27 | _SESSIONTOKEN_TOKEN._serialized_start=193 28 | _SESSIONTOKEN_TOKEN._serialized_end=219 29 | # @@protoc_insertion_point(module_scope) 30 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/text_markdown_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/text_markdown.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"messagepath/v1/text_markdown.proto\x12\x15\x63ommon.messagepath.v1\x1a\x19protobuf_validation.proto\"3\n\x16TextMarkdownAttachment\x12\x19\n\x08markdown\x18\x01 \x01(\tB\x07\xca\x9d%\x03\x30\xc4\x13\x42z\n\x19\x63om.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\xa2\x02\x04MPTHb\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.text_markdown_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\004MPTH' 25 | _TEXTMARKDOWNATTACHMENT.fields_by_name['markdown']._options = None 26 | _TEXTMARKDOWNATTACHMENT.fields_by_name['markdown']._serialized_options = b'\312\235%\0030\304\023' 27 | _TEXTMARKDOWNATTACHMENT._serialized_start=88 28 | _TEXTMARKDOWNATTACHMENT._serialized_end=139 29 | # @@protoc_insertion_point(module_scope) 30 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | from codecs import open 3 | from os import path 4 | 5 | here = path.abspath(path.dirname(__file__)) 6 | 7 | # Get the long description from the README file 8 | with open(path.join(here, "README.md"), encoding="utf-8") as fh: 9 | long_description = "\n" + fh.read() 10 | 11 | VERSION = "0.5.0" 12 | DESCRIPTION = "Python API for writing unoffical kik bots that act like humans" 13 | 14 | setup( 15 | name="kik_unofficial", 16 | version=VERSION, 17 | author="Tomer", 18 | author_email="tomer8007@gmail.com", 19 | description=DESCRIPTION, 20 | long_description_content_type="text/markdown", 21 | long_description=long_description, 22 | url="https://github.com/tomer8007/kik-bot-api-unofficial", 23 | download_url="https://github.com/tomer8007/kik-bot-api-unofficial/tarball/new", 24 | license="MIT", 25 | classifiers=[ 26 | "Development Status :: 3 - Alpha", 27 | "Intended Audience :: Developers", 28 | "Programming Language :: Python :: 3", 29 | ], 30 | keywords=[ 31 | "kik", 32 | "bot", 33 | "kikbot", 34 | "kik-messenger-platform", 35 | "api", 36 | "unofficial", 37 | "python", 38 | ], 39 | packages=find_packages(exclude=["docs", "test"]), 40 | install_requires=[ 41 | "pbkdf2", 42 | "rsa", 43 | "lxml", 44 | "bs4", 45 | "protobuf>=4.21.0", 46 | "requests", 47 | "pillow", 48 | "pyDes", 49 | "python-dotenv", 50 | "PyYAML~=6.0.1", 51 | "defusedxml~=0.7.1", 52 | "lxml~=4.9.3", 53 | "beautifulsoup4~=4.12.2", 54 | "colorama", 55 | ], 56 | extras_require={"dev": [], "test": []}, 57 | package_data={"kik_unofficial": []}, 58 | entry_points={"console_scripts": ["kikapi=kik_unofficial.cmdline:execute"]}, 59 | ) 60 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/kin/authentication/v1/authentication_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: kin/authentication/v1/authentication_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 16 | import kik_unofficial.protobuf.common.v1_pb2 as model 17 | 18 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 19 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kin.authentication.v1.authentication_common_pb2', globals()) 20 | if _descriptor._USE_C_DESCRIPTORS == False: 21 | 22 | DESCRIPTOR._options = None 23 | DESCRIPTOR._serialized_options = b'\n com.kik.kin.authentication.modelZ`github.com/kikinteractive/xiphias-model-common/generated/go/kin/authentication/v1;authentication' 24 | _OFFERID.fields_by_name['feature_offer_id']._options = None 25 | _OFFERID.fields_by_name['feature_offer_id']._serialized_options = b'\312\235%\005(\0010\200\001' 26 | _OFFERJWT.fields_by_name['id']._options = None 27 | _OFFERJWT.fields_by_name['id']._serialized_options = b'\312\235%\002\010\001' 28 | _OFFERJWT.fields_by_name['jwt']._options = None 29 | _OFFERJWT.fields_by_name['jwt']._serialized_options = b'\312\235%\002\010\001' 30 | _OFFERID._serialized_start=153 31 | _OFFERID._serialized_end=248 32 | _OFFERJWT._serialized_start=250 33 | _OFFERJWT._serialized_end=358 34 | # @@protoc_insertion_point(module_scope) 35 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/mobile_video_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobileremote.video.v1; 4 | option java_package = "com.kik.video.mobileremote"; 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobileremote/generated/go/video/v1;video"; 6 | 7 | import "protobuf_validation.proto"; 8 | import "common_model.proto"; 9 | import "common_rpc.proto"; 10 | import "video/v1/video_common.proto"; 11 | 12 | // 13 | // This is the service which conceptually lives on the client. 14 | // 15 | // A high level system diagram can be found in xiphias_api_mobile.kik_vide_service.proto 16 | // 17 | service MobileVideo { 18 | // This API is used to notify clients of changes in any convos they are a part of. 19 | // 20 | // A notification should be sent to ALL members of a group, not just those active in the video 21 | // chat. 22 | // 23 | // As with all mobileremote services (as of Oct 2016), this notification is NOT durable and will 24 | // ONLY be sent to the client when they have an active connection. After opening a connection, 25 | // the client is expected to use the mobile.video.v1.KikVideo.BatchedGetConvoState service to 26 | // load initial state 27 | rpc OnConvoVideoStateChanged(OnConvoVideoStateChangedNotification) returns (common.VoidResponse); 28 | } 29 | 30 | message OnConvoVideoStateChangedNotification { 31 | common.video.v1.ConvoVideoState convo_video_state = 1; 32 | 33 | // Uniquely identifies a push notification of a state change. This is used to relate a 34 | // push harpy event (sent from InternalKikVideoService) and the client push ack'd harpy event. 35 | // 36 | // Consumers of this service should _not_ make any assumptions about the underlying data 37 | // format of the notification_id. 38 | string notification_id = 2 [(kik.validation.field_validation) = { 39 | max_byte_length: 36 40 | }]; 41 | } 42 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/signal/v2/model_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: signal/v2/model.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.common.v2_pb2 as model 16 | 17 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 18 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'signal.v2.model_pb2', globals()) 19 | if _descriptor._USE_C_DESCRIPTORS == False: 20 | 21 | DESCRIPTOR._options = None 22 | DESCRIPTOR._serialized_options = b'\n\025com.kik.gen.signal.v2ZLgithub.com/kikinteractive/xiphias-model-common/generated/go/signal/v2;signal\242\002\021KPBCommonSignalV2' 23 | _SIGNAL_ID.fields_by_name['raw_value']._options = None 24 | _SIGNAL_ID.fields_by_name['raw_value']._serialized_options = b'\312\235%\006\010\001(\0200 ' 25 | _SIGNAL.fields_by_name['id']._options = None 26 | _SIGNAL.fields_by_name['id']._serialized_options = b'\312\235%\002\010\001' 27 | _PERSONASIGNAL.fields_by_name['persona_id']._options = None 28 | _PERSONASIGNAL.fields_by_name['persona_id']._serialized_options = b'\312\235%\002\010\000' 29 | _SIGNAL._serialized_start=94 30 | _SIGNAL._serialized_end=312 31 | _SIGNAL_ID._serialized_start=269 32 | _SIGNAL_ID._serialized_end=304 33 | _GLOBALSIGNAL._serialized_start=314 34 | _GLOBALSIGNAL._serialized_end=328 35 | _PERSONASIGNAL._serialized_start=330 36 | _PERSONASIGNAL._serialized_end=395 37 | # @@protoc_insertion_point(module_scope) 38 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/adaptive_cards.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.messagepath.v1; 4 | 5 | option java_package = "com.kik.messagepath.model"; 6 | option objc_class_prefix = "MPTH"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 8 | 9 | import "protobuf_validation.proto"; 10 | 11 | // AdaptiveCardAttachment defines the mechanism that allows bots to send an adaptive card message 12 | // defined using Microsoft's Adaptive Cards framework (see http://adaptivecards.io). 13 | // 14 | // By using this framework, developers can define a card in JSON composed of images, text, buttons 15 | // and more using Microsoft's schema. These card definitions can be used across multiple platforms. 16 | // 17 | // This attachment should be used by the client to determine how to render an adaptive card message. 18 | message AdaptiveCardAttachment { 19 | // This split between card_id and card_definition provides flexibility in how adaptive cards get 20 | // implemented long-term. card_definition will be used for a simpler implementation of sending 21 | // the JSON directly to the client, while card_id provides a way to work around size limitations 22 | // if necessary for future features. 23 | oneof content { 24 | // The ID of the adaptive card definition stored on the bots platform. The client will use 25 | // this ID to retrieve the JSON definition of the card from the bots platform and then 26 | // render it. 27 | string card_id = 1 [(kik.validation.field_validation) = { 28 | min_byte_length: 1 29 | max_byte_length: 64 30 | }]; 31 | // The dump of the JSON adaptive card definition. 32 | string card_definition = 2 [(kik.validation.field_validation) = { 33 | min_byte_length: 2 34 | max_byte_length: 10000 35 | }]; 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/feature_payment_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/feature_payment.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$messagepath/v1/feature_payment.proto\x12\x15\x63ommon.messagepath.v1\x1a\x19protobuf_validation.proto\"\x9c\x01\n\x1cTransactionDetailsAttachment\x12J\n\x06target\x18\x01 \x01(\x0e\x32:.common.messagepath.v1.TransactionDetailsAttachment.Target\"0\n\x06Target\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06SENDER\x10\x01\x12\r\n\tRECIPIENT\x10\x02\x42y\n\x19\x63om.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\xa2\x02\x03KPBb\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.feature_payment_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\003KPB' 25 | _TRANSACTIONDETAILSATTACHMENT._serialized_start=91 26 | _TRANSACTIONDETAILSATTACHMENT._serialized_end=247 27 | _TRANSACTIONDETAILSATTACHMENT_TARGET._serialized_start=199 28 | _TRANSACTIONDETAILSATTACHMENT_TARGET._serialized_end=247 29 | # @@protoc_insertion_point(module_scope) 30 | -------------------------------------------------------------------------------- /examples/legacy/echo_bot_legacy.py: -------------------------------------------------------------------------------- 1 | """ 2 | The echo bot sends back whatever messages he gets. 3 | """ 4 | 5 | import sys 6 | import time 7 | import logging 8 | 9 | from kik_unofficial.client import KikClient 10 | 11 | 12 | def main(): 13 | username, password = "shlomo991", "123456" 14 | kik_client = KikClient(username, password) 15 | 16 | print("[+] Listening for incoming events.") 17 | 18 | # main events loop 19 | while True: 20 | 21 | info = kik_client.get_next_event() 22 | if "type" not in info: 23 | continue 24 | 25 | if info["type"] == "message_read": 26 | print("[+] Human has read the message (user " + info["from"] + ", message id: " + info["message_id"] + ")") 27 | 28 | elif info["type"] == "is_typing": 29 | if info["is_typing"]: 30 | print("[+] Human is typing (user " + info["from"] + ")") 31 | else: 32 | print("[+] Human is not typing (user " + info["from"] + ")") 33 | 34 | elif info["type"] == "message": 35 | partner = info["from"] 36 | print("[+] Human says: \"" + info["body"] + "\" (user " + partner + ")") 37 | 38 | kik_client.send_read_confirmation(partner, info["message_id"]) 39 | replay = "You said '" + info["body"] + "'!" 40 | kik_client.send_is_typing(partner, "true") 41 | time.sleep(0.2 * len(replay)) 42 | kik_client.send_is_typing(partner, "false") 43 | kik_client.send_message(partner, replay) 44 | 45 | elif info["type"] == "end": 46 | print("[!] Server ended communication.") 47 | break 48 | 49 | print("[+] Done!") 50 | kik_client.close() 51 | 52 | 53 | if __name__ == '__main__': 54 | if sys.version_info[0] < 3: 55 | raise Exception("Must be using Python 3!!") 56 | try: 57 | main() 58 | except KeyboardInterrupt: 59 | print("[!] User stopped execution.") 60 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/protobuf_validation.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; // Need proto2 for custom options 2 | 3 | package kik.validation; 4 | option java_package = "com.kik.protovalidation"; 5 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/kikoptions;kikoptions"; 6 | 7 | import "google/protobuf/descriptor.proto"; 8 | 9 | // 10 | // Note that currently this file contains the master list of field option extension numbers used at kik 11 | // 12 | 13 | extend google.protobuf.FieldOptions { 14 | // Note tag is just a random number between 50000-99999 15 | // (see https://developers.google.com/protocol-buffers/docs/proto#customoptions) 16 | optional FieldValidation field_validation = 76249; 17 | optional FieldValidation map_key = 76250; 18 | // Tag number 76251 is used in xiphias-model-common/proto/messagepath/v1/core_message_options.proto 19 | } 20 | 21 | message FieldValidation { 22 | // TODO: Document semantics of this 23 | optional bool mandatory = 1 [default = false]; 24 | 25 | optional string regex = 2; 26 | 27 | //optional bool exclusive_min = 9 [default = false]; 28 | //optional bool exclusive_max = 10 [default = false]; 29 | 30 | // For strings: 31 | optional int32 min_codepoints = 3; 32 | optional int32 max_codepoints = 4; 33 | 34 | // Valid for strings and byte arrays: 35 | optional int32 min_byte_length = 5; 36 | optional int32 max_byte_length = 6; 37 | 38 | optional sfixed64 min_val = 7; 39 | optional sfixed64 max_val = 8; 40 | 41 | optional double min_double_val = 11; 42 | optional double max_double_val = 12; 43 | 44 | optional uint32 min_repetitions = 15; 45 | optional uint32 max_repetitions = 16; 46 | 47 | // Valid on repeated fields ONLY (with some additional restrictions on what those fields can contain) 48 | optional Order ordered = 17; 49 | enum Order { 50 | // Ascending (smaller to bigger) 51 | ASC = 0; 52 | // Descending (bigger to smaller) 53 | DESC = 1; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/mentions_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/mentions.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 15 | import kik_unofficial.protobuf.common.v1_pb2 as model 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmessagepath/v1/mentions.proto\x12\x15\x63ommon.messagepath.v1\x1a\x12\x63ommon_model.proto\x1a\x15\x63ommon/v1/model.proto\x1a\x19protobuf_validation.proto\"\x98\x01\n\x16MentionReplyAttachment\x12;\n\x12original_mentioner\x18\x01 \x01(\x0b\x32\x15.common.XiBareUserJidB\x08\x18\x01\xca\x9d%\x02\x08\x00\x12\x41\n\x15original_mentioner_v2\x18\x02 \x01(\x0b\x32\".common.v1.XiBareUserJidOrAliasJidBz\n\x19\x63om.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\xa2\x02\x04MPTHb\x06proto3') 19 | 20 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 21 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.mentions_pb2', globals()) 22 | if _descriptor._USE_C_DESCRIPTORS == False: 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\004MPTH' 26 | _MENTIONREPLYATTACHMENT.fields_by_name['original_mentioner']._options = None 27 | _MENTIONREPLYATTACHMENT.fields_by_name['original_mentioner']._serialized_options = b'\030\001\312\235%\002\010\000' 28 | _MENTIONREPLYATTACHMENT._serialized_start=127 29 | _MENTIONREPLYATTACHMENT._serialized_end=279 30 | # @@protoc_insertion_point(module_scope) 31 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/profile/v2/profile_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: profile/v2/profile_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fprofile/v2/profile_common.proto\x12\x11\x63ommon.profile.v2\x1a\x19protobuf_validation.proto\"R\n\x15\x44isplayNameComponents\x12\x1d\n\nfirst_name\x18\x01 \x01(\tB\t\xca\x9d%\x05\x08\x01\x30\xff\x01\x12\x1a\n\tlast_name\x18\x02 \x01(\tB\x07\xca\x9d%\x03\x30\xff\x01\x42}\n\x16\x63om.kik.gen.profile.v2ZNgithub.com/kikinteractive/xiphias-model-common/generated/go/profile/v2;profile\xa2\x02\x12KPBCommonProfileV2b\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'profile.v2.profile_common_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\026com.kik.gen.profile.v2ZNgithub.com/kikinteractive/xiphias-model-common/generated/go/profile/v2;profile\242\002\022KPBCommonProfileV2' 25 | _DISPLAYNAMECOMPONENTS.fields_by_name['first_name']._options = None 26 | _DISPLAYNAMECOMPONENTS.fields_by_name['first_name']._serialized_options = b'\312\235%\005\010\0010\377\001' 27 | _DISPLAYNAMECOMPONENTS.fields_by_name['last_name']._options = None 28 | _DISPLAYNAMECOMPONENTS.fields_by_name['last_name']._serialized_options = b'\312\235%\0030\377\001' 29 | _DISPLAYNAMECOMPONENTS._serialized_start=81 30 | _DISPLAYNAMECOMPONENTS._serialized_end=163 31 | # @@protoc_insertion_point(module_scope) 32 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/kin/authentication/v1/authentication_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: kin/authentication/v1/authentication_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 16 | import kik_unofficial.protobuf.common.v1_pb2 as model 17 | 18 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 19 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kin.authentication.v1.authentication_service_pb2', globals()) 20 | if _descriptor._USE_C_DESCRIPTORS == False: 21 | 22 | DESCRIPTOR._options = None 23 | DESCRIPTOR._serialized_options = b'\n\036com.kik.kin.authentication.rpcZ^github.com/kikinteractive/xiphias-api-mobile/generated/go/kin/authentication/v1;authentication' 24 | _GENERATEUSERJWTREQUEST.fields_by_name['user_jid']._options = None 25 | _GENERATEUSERJWTREQUEST.fields_by_name['user_jid']._serialized_options = b'\312\235%\002\010\001' 26 | _GENERATEUSERJWTREQUEST._serialized_start=154 27 | _GENERATEUSERJWTREQUEST._serialized_end=227 28 | _GENERATEUSERJWTRESPONSE._serialized_start=230 29 | _GENERATEUSERJWTRESPONSE._serialized_end=481 30 | _GENERATEUSERJWTRESPONSE_RESULT._serialized_start=451 31 | _GENERATEUSERJWTRESPONSE_RESULT._serialized_end=481 32 | _USERJWTREJECTIONREASON._serialized_start=484 33 | _USERJWTREJECTIONREASON._serialized_end=636 34 | _USERJWTREJECTIONREASON_CODE._serialized_start=583 35 | _USERJWTREJECTIONREASON_CODE._serialized_end=636 36 | _AUTHENTICATION._serialized_start=639 37 | _AUTHENTICATION._serialized_end=783 38 | # @@protoc_insertion_point(module_scope) 39 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/adaptive_cards_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/adaptive_cards.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#messagepath/v1/adaptive_cards.proto\x12\x15\x63ommon.messagepath.v1\x1a\x19protobuf_validation.proto\"f\n\x16\x41\x64\x61ptiveCardAttachment\x12\x1b\n\x07\x63\x61rd_id\x18\x01 \x01(\tB\x08\xca\x9d%\x04(\x01\x30@H\x00\x12$\n\x0f\x63\x61rd_definition\x18\x02 \x01(\tB\t\xca\x9d%\x05(\x02\x30\x90NH\x00\x42\t\n\x07\x63ontentBz\n\x19\x63om.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\xa2\x02\x04MPTHb\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.adaptive_cards_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\004MPTH' 25 | _ADAPTIVECARDATTACHMENT.fields_by_name['card_id']._options = None 26 | _ADAPTIVECARDATTACHMENT.fields_by_name['card_id']._serialized_options = b'\312\235%\004(\0010@' 27 | _ADAPTIVECARDATTACHMENT.fields_by_name['card_definition']._options = None 28 | _ADAPTIVECARDATTACHMENT.fields_by_name['card_definition']._serialized_options = b'\312\235%\005(\0020\220N' 29 | _ADAPTIVECARDATTACHMENT._serialized_start=89 30 | _ADAPTIVECARDATTACHMENT._serialized_end=191 31 | # @@protoc_insertion_point(module_scope) 32 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/groups/v2/groups_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: groups/v2/groups_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dgroups/v2/groups_common.proto\x12\x10\x63ommon.groups.v2\x1a\x19protobuf_validation.proto\"G\n\x11PublicGroupFields\x12\x32\n\x07hashtag\x18\x01 \x01(\x0b\x32\x19.common.groups.v2.HashtagB\x06\xca\x9d%\x02\x08\x01\"3\n\x07Hashtag\x12(\n\x07hashtag\x18\x01 \x01(\tB\x17\xca\x9d%\x13\x08\x01\x12\x0f^#[\\w\\.]{2,32}$By\n\x15\x63om.kik.gen.groups.v2ZLgithub.com/kikinteractive/xiphias-model-common/generated/go/groups/v2;groups\xa2\x02\x11KPBCommonGroupsV2b\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'groups.v2.groups_common_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\025com.kik.gen.groups.v2ZLgithub.com/kikinteractive/xiphias-model-common/generated/go/groups/v2;groups\242\002\021KPBCommonGroupsV2' 25 | _PUBLICGROUPFIELDS.fields_by_name['hashtag']._options = None 26 | _PUBLICGROUPFIELDS.fields_by_name['hashtag']._serialized_options = b'\312\235%\002\010\001' 27 | _HASHTAG.fields_by_name['hashtag']._options = None 28 | _HASHTAG.fields_by_name['hashtag']._serialized_options = b'\312\235%\023\010\001\022\017^#[\\w\\.]{2,32}$' 29 | _PUBLICGROUPFIELDS._serialized_start=78 30 | _PUBLICGROUPFIELDS._serialized_end=149 31 | _HASHTAG._serialized_start=151 32 | _HASHTAG._serialized_end=202 33 | # @@protoc_insertion_point(module_scope) 34 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/core_message_options_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/core_message_options.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)messagepath/v1/core_message_options.proto\x12\x15\x63ommon.messagepath.v1\x1a google/protobuf/descriptor.proto\"\x87\x01\n\x1c\x43oreMessageOriginRestriction\x12H\n\x04\x64\x65ny\x18\x01 \x03(\x0e\x32:.common.messagepath.v1.CoreMessageOriginRestriction.Origin\"\x1d\n\x06Origin\x12\n\n\x06MOBILE\x10\x00\x12\x07\n\x03\x42OT\x10\x01:p\n\x12origin_restriction\x12\x1d.google.protobuf.FieldOptions\x18\xdb\xd3\x04 \x01(\x0b\x32\x33.common.messagepath.v1.CoreMessageOriginRestrictionBs\n\x19\x63om.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.core_message_options_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(origin_restriction) 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath' 26 | _COREMESSAGEORIGINRESTRICTION._serialized_start=103 27 | _COREMESSAGEORIGINRESTRICTION._serialized_end=238 28 | _COREMESSAGEORIGINRESTRICTION_ORIGIN._serialized_start=209 29 | _COREMESSAGEORIGINRESTRICTION_ORIGIN._serialized_end=238 30 | # @@protoc_insertion_point(module_scope) 31 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/chats/v2/chat_info_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.chats.v2; 4 | 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/chats/v2;chats"; 6 | option java_package = "com.kik.gen.chats.v2"; 7 | option objc_class_prefix = "KPBMobileChatsV2"; 8 | 9 | import "protobuf_validation.proto"; 10 | import "common/v2/model.proto"; 11 | import "messaging/v2/model.proto"; 12 | 13 | service ChatInfo { 14 | // GetChatStream streams batches of chat info corresponding to the requested 15 | // set of ChatIds. This should be called for any type of chat for which the 16 | // client needs to know more than just the ChatId. 17 | // 18 | // Chat info includes contextual information like the type of 19 | // chat and other minimal information specific to that type of chat needed to display it. 20 | rpc GetChatInfoStream(GetChatInfoStreamRequest) returns (stream GetChatInfoStreamResponse) {} 21 | } 22 | 23 | message GetChatInfoStreamRequest { 24 | repeated common.v2.ChatId chat_ids = 1 [(kik.validation.field_validation) = { 25 | mandatory: true 26 | min_repetitions: 1 27 | max_repetitions: 1024 // Sanity bound 28 | }]; 29 | } 30 | 31 | message GetChatInfoStreamResponse { 32 | Result result = 1; 33 | enum Result { 34 | // The request was successfully processed. Note that this does not mean all chat ids 35 | // specified in the request were sucessfully retrieved. See failure_details for any failures. 36 | OK = 0; 37 | } 38 | 39 | // Successfully retrieved chat information corresponding to chat ids given in the request. 40 | repeated common.messaging.v2.Chat chats = 2; 41 | 42 | // Chats that failed to be retrieved by id. 43 | repeated FailureDetails failure_details = 3; 44 | message FailureDetails { 45 | common.v2.ChatId chat_id = 1; 46 | 47 | Reason reason = 2; 48 | enum Reason { 49 | UNKNOWN = 0; 50 | 51 | // No chat info was found for this chat_id that can be returned to the caller's account. 52 | NOT_FOUND = 1; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/carousels.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.messagepath.v1; 4 | 5 | option java_package = "com.kik.messagepath.model"; 6 | option objc_class_prefix = "MPTH"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 8 | 9 | import "common_model.proto"; 10 | import "protobuf_validation.proto"; 11 | 12 | import "messagepath/v1/keyboards.proto"; 13 | import "messagepath/v1/link_message.proto"; 14 | 15 | // CarouselMessageAttachment defines the properties required to render a carousel message sent by a 16 | // bot. A carousel message contains multiple pieces of content that can be scrolled through 17 | // horizontally. 18 | message CarouselMessageAttachment { 19 | repeated CarouselItem items = 1 [(kik.validation.field_validation) = { 20 | mandatory: true 21 | min_repetitions: 1 22 | max_repetitions: 1000 23 | }]; 24 | } 25 | 26 | // CarouselItem defines a single piece of content in a carousel. 27 | message CarouselItem { 28 | // The option to send either message_id or content provides flexibility in how carousels get 29 | // implemented. `content` provides the ability for the client to immediately render the content 30 | // of an item, while message_id provides a way to work around XMPP size limitations if needed. 31 | // message_id is the ID of a XMPP message stanza that should render as another card in the 32 | // carousel. 33 | oneof item { 34 | common.XiUuid message_id = 1; 35 | CarouselItemContent content = 2; 36 | } 37 | } 38 | 39 | message CarouselItemContent { 40 | // Each carousel item can have its own keyboard attachment. 41 | KeyboardAttachment keyboard_attachment = 30; 42 | 43 | // In the event the client encounters a carousel item type that is newer than its protobuf 44 | // definition, no `type` will be parseable from the CarouselItemContent that arrives. In this 45 | // scenario, clients should show the user a carousel item element that indicates this type is 46 | // not known. 47 | oneof type { 48 | LinkMessageAttachment link_message_attachment = 31; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/widgets_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/widgets.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 15 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 16 | import kik_unofficial.protobuf.messagepath.v1_pb2 as keyboards 17 | 18 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 19 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.widgets_pb2', globals()) 20 | if _descriptor._USE_C_DESCRIPTORS == False: 21 | 22 | DESCRIPTOR._options = None 23 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\004MPTH' 24 | _WIDGETATTACHMENT.fields_by_name['widgets']._options = None 25 | _WIDGETATTACHMENT.fields_by_name['widgets']._serialized_options = b'\312\235%\010\010\001x\001\200\001\350\007' 26 | _WIDGET.fields_by_name['to']._options = None 27 | _WIDGET.fields_by_name['to']._serialized_options = b'\312\235%\002\010\000' 28 | _TEXTWIDGET.fields_by_name['body']._options = None 29 | _TEXTWIDGET.fields_by_name['body']._serialized_options = b'\312\235%\007\010\001(\0010\350\007' 30 | _TEXTWIDGET.fields_by_name['title']._options = None 31 | _TEXTWIDGET.fields_by_name['title']._serialized_options = b'\312\235%\005\010\0000\350\007' 32 | _TEXTWIDGET.fields_by_name['keyboard']._options = None 33 | _TEXTWIDGET.fields_by_name['keyboard']._serialized_options = b'\312\235%\002\010\000' 34 | _WIDGETATTACHMENT._serialized_start=134 35 | _WIDGETATTACHMENT._serialized_end=214 36 | _WIDGET._serialized_start=216 37 | _WIDGET._serialized_end=333 38 | _TEXTWIDGET._serialized_start=335 39 | _TEXTWIDGET._serialized_end=459 40 | # @@protoc_insertion_point(module_scope) 41 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/abtesting/v1/ab_testing_shared_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: abtesting/v1/ab_testing_shared.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$abtesting/v1/ab_testing_shared.proto\x12\x13\x63ommon.abtesting.v1\x1a\x19protobuf_validation.proto\"i\n\nExperiment\x12\x19\n\x04name\x18\x01 \x01(\tB\x0b\xca\x9d%\x07\x08\x01(\x01\x30\xff\x01\x12\x1c\n\x07variant\x18\x02 \x01(\tB\x0b\xca\x9d%\x07\x08\x01(\x01\x30\xff\x01\x12\"\n\rexperiment_id\x18\x03 \x01(\tB\x0b\xca\x9d%\x07\x08\x00(\x00\x30\xff\x01\x42r\n\x15\x63om.kik.abtesting.rpcZRgithub.com/kikinteractive/xiphias-model-common/generated/go/abtesting/v1;abtesting\xa2\x02\x04XIABb\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'abtesting.v1.ab_testing_shared_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\025com.kik.abtesting.rpcZRgithub.com/kikinteractive/xiphias-model-common/generated/go/abtesting/v1;abtesting\242\002\004XIAB' 25 | _EXPERIMENT.fields_by_name['name']._options = None 26 | _EXPERIMENT.fields_by_name['name']._serialized_options = b'\312\235%\007\010\001(\0010\377\001' 27 | _EXPERIMENT.fields_by_name['variant']._options = None 28 | _EXPERIMENT.fields_by_name['variant']._serialized_options = b'\312\235%\007\010\001(\0010\377\001' 29 | _EXPERIMENT.fields_by_name['experiment_id']._options = None 30 | _EXPERIMENT.fields_by_name['experiment_id']._serialized_options = b'\312\235%\007\010\000(\0000\377\001' 31 | _EXPERIMENT._serialized_start=88 32 | _EXPERIMENT._serialized_end=193 33 | # @@protoc_insertion_point(module_scope) 34 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/core_message_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.messagepath.v1; 4 | 5 | option java_package = "com.kik.messagepath.model"; 6 | option objc_class_prefix = "MPTH"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 8 | 9 | import "common_model.proto"; 10 | import "protobuf_validation.proto"; 11 | 12 | //************************************************** 13 | // 14 | // Contains elements that are shared by different 15 | // message types 16 | // 17 | //************************************************** 18 | 19 | // AttributionAttachment is used to define the entity the content should be attributed to. 20 | // Attribution information is typically displayed below content messages and represents the source 21 | // of the content. 22 | message AttributionAttachment { 23 | // The name of the source 24 | string name = 1 [(kik.validation.field_validation) = { max_byte_length: 500 }]; 25 | // The icon representing the source 26 | PictureElement icon = 2; 27 | } 28 | 29 | // ContentLayoutElement defines which content layout the client should use to render a 30 | // content message. 31 | message ContentLayoutElement { 32 | ContentLayoutType type = 1; 33 | enum ContentLayoutType { 34 | DEFAULT = 0; 35 | ARTICLE = 1; 36 | PHOTO = 2; 37 | VIDEO = 3; 38 | } 39 | } 40 | 41 | // PictureElement is used to define a picture sent in a message 42 | message PictureElement { 43 | // The URL of the full-sized image 44 | string url = 1 [(kik.validation.field_validation) = { max_byte_length: 5120 }]; 45 | } 46 | 47 | // UriElement is used to describe a URI sent in a message 48 | message UriElement { 49 | string uri = 1 [(kik.validation.field_validation) = { 50 | mandatory: true 51 | max_byte_length: 5120 52 | }]; 53 | 54 | // The platform this URI should be displayed on. 55 | Platform platform = 100; 56 | enum Platform { 57 | ALL = 0; 58 | WEB = 1; 59 | IOS = 2; 60 | ANDROID = 3; 61 | WIDGET = 4; 62 | } 63 | 64 | // Describes the priority of the URI (the lower the number the higher the priority) 65 | uint32 priority = 1000; 66 | } 67 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/chats/v2/chats_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: chats/v2/chats_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common.v2_pb2 as model 15 | from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x63hats/v2/chats_common.proto\x12\x0f\x63ommon.chats.v2\x1a\x15\x63ommon/v2/model.proto\x1a\x19protobuf_validation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"2\n\x0b\x43hatThemeId\x12#\n\x02id\x18\x01 \x01(\x0b\x32\x0f.common.v2.UuidB\x06\xca\x9d%\x02\x08\x01\"\x90\x01\n\nMuteStatus\x12\x32\n\x06status\x18\x01 \x01(\x0e\x32\".common.chats.v2.MuteStatus.Status\x12*\n\x06\x65xpiry\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\"\n\x06Status\x12\r\n\tNOT_MUTED\x10\x00\x12\t\n\x05MUTED\x10\x01\x42u\n\x14\x63om.kik.gen.chats.v2ZJgithub.com/kikinteractive/xiphias-model-common/generated/go/chats/v2;chats\xa2\x02\x10KPBCommonChatsV2b\x06proto3') 19 | 20 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 21 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'chats.v2.chats_common_pb2', globals()) 22 | if _descriptor._USE_C_DESCRIPTORS == False: 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\024com.kik.gen.chats.v2ZJgithub.com/kikinteractive/xiphias-model-common/generated/go/chats/v2;chats\242\002\020KPBCommonChatsV2' 26 | _CHATTHEMEID.fields_by_name['id']._options = None 27 | _CHATTHEMEID.fields_by_name['id']._serialized_options = b'\312\235%\002\010\001' 28 | _CHATTHEMEID._serialized_start=131 29 | _CHATTHEMEID._serialized_end=181 30 | _MUTESTATUS._serialized_start=184 31 | _MUTESTATUS._serialized_end=328 32 | _MUTESTATUS_STATUS._serialized_start=294 33 | _MUTESTATUS_STATUS._serialized_end=328 34 | # @@protoc_insertion_point(module_scope) 35 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/persona/v2/persona_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: persona/v2/persona_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.common.v2_pb2 as model 16 | 17 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 18 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'persona.v2.persona_service_pb2', globals()) 19 | if _descriptor._USE_C_DESCRIPTORS == False: 20 | 21 | DESCRIPTOR._options = None 22 | DESCRIPTOR._serialized_options = b'\n\026com.kik.gen.persona.v2ZLgithub.com/kikinteractive/xiphias-api-mobile/generated/go/persona/v2;persona\242\002\022KPBMobilePersonaV2' 23 | _SETDISPLAYNAMEREQUEST_FIRSTLASTNAME.fields_by_name['first_name']._options = None 24 | _SETDISPLAYNAMEREQUEST_FIRSTLASTNAME.fields_by_name['first_name']._serialized_options = b'\312\235%\005\010\001 \377\001' 25 | _SETDISPLAYNAMEREQUEST_FIRSTLASTNAME.fields_by_name['last_name']._options = None 26 | _SETDISPLAYNAMEREQUEST_FIRSTLASTNAME.fields_by_name['last_name']._serialized_options = b'\312\235%\003 \377\001' 27 | _SETDISPLAYNAMEREQUEST.fields_by_name['persona_id']._options = None 28 | _SETDISPLAYNAMEREQUEST.fields_by_name['persona_id']._serialized_options = b'\312\235%\002\010\001' 29 | _SETDISPLAYNAMEREQUEST._serialized_start=106 30 | _SETDISPLAYNAMEREQUEST._serialized_end=350 31 | _SETDISPLAYNAMEREQUEST_FIRSTLASTNAME._serialized_start=260 32 | _SETDISPLAYNAMEREQUEST_FIRSTLASTNAME._serialized_end=334 33 | _SETDISPLAYNAMERESPONSE._serialized_start=353 34 | _SETDISPLAYNAMERESPONSE._serialized_end=543 35 | _SETDISPLAYNAMERESPONSE_RESULT._serialized_start=445 36 | _SETDISPLAYNAMERESPONSE_RESULT._serialized_end=543 37 | _PERSONA._serialized_start=545 38 | _PERSONA._serialized_end=659 39 | # @@protoc_insertion_point(module_scope) 40 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/badgecount/v1/badge_count_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: badgecount/v1/badge_count_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 15 | import kik_unofficial.protobuf.common_rpc_pb2 as common__rpc__pb2 16 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 17 | 18 | 19 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'badgecount/v1/badge_count_service.proto\x12\x14mobile.badgecount.v1\x1a\x12\x63ommon_model.proto\x1a\x10\x63ommon_rpc.proto\x1a\x19protobuf_validation.proto\"}\n\x1dSetUnreadConversationsRequest\x12\x46\n\x14\x63onversations_unread\x18\x01 \x03(\x0b\x32\x1c.common.XiBareUserOrGroupJidB\n\xca\x9d%\x06\x08\x00\x80\x01\xc8\x01\x12\x14\n\x0cunread_count\x18\x02 \x01(\r2q\n\nBadgeCount\x12\x63\n\x16SetUnreadConversations\x12\x33.mobile.badgecount.v1.SetUnreadConversationsRequest\x1a\x14.common.VoidResponseBl\n\x16\x63om.kik.badgecount.rpcZRgithub.com/kikinteractive/xiphias-api-mobile/generated/go/badgecount/v1;badgecountb\x06proto3') 20 | 21 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 22 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'badgecount.v1.badge_count_service_pb2', globals()) 23 | if _descriptor._USE_C_DESCRIPTORS == False: 24 | 25 | DESCRIPTOR._options = None 26 | DESCRIPTOR._serialized_options = b'\n\026com.kik.badgecount.rpcZRgithub.com/kikinteractive/xiphias-api-mobile/generated/go/badgecount/v1;badgecount' 27 | _SETUNREADCONVERSATIONSREQUEST.fields_by_name['conversations_unread']._options = None 28 | _SETUNREADCONVERSATIONSREQUEST.fields_by_name['conversations_unread']._serialized_options = b'\312\235%\006\010\000\200\001\310\001' 29 | _SETUNREADCONVERSATIONSREQUEST._serialized_start=130 30 | _SETUNREADCONVERSATIONSREQUEST._serialized_end=255 31 | _BADGECOUNT._serialized_start=257 32 | _BADGECOUNT._serialized_end=370 33 | # @@protoc_insertion_point(module_scope) 34 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/signal/v2/model.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.signal.v2; 4 | 5 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/signal/v2;signal"; 6 | option java_package = "com.kik.gen.signal.v2"; 7 | option objc_class_prefix = "KPBCommonSignalV2"; 8 | 9 | import "protobuf_validation.proto"; 10 | import "common/v2/model.proto"; 11 | 12 | // A signal notifies a client that an action should be performed. It's primary 13 | // intention is to be a mechanism in which services can 'signal' a user client 14 | // to perform some kind of action in a reliable way. It is _not_ a mechanism 15 | // to send data, or synchronize data in and of itself. It _can_, however, be 16 | // used as a mechanism to indicate that synchronization should be performed. 17 | // 18 | // See the related services in xiphias-api-internal and xiphias-api-mobile for 19 | // usage details. 20 | message Signal { 21 | // Id is _only_ generated by the internal signal service. It is opaque to 22 | // the rest of the world (both internal and external). 23 | Id id = 1 [(kik.validation.field_validation) = { 24 | mandatory: true 25 | }]; 26 | 27 | // Id is a byte-wise lexicographically sortable Id used for synchronizing 28 | // the signal stream between clients and server. 29 | message Id { 30 | bytes raw_value = 1 [(kik.validation.field_validation) = { 31 | mandatory: true 32 | min_byte_length: 16 33 | max_byte_length: 32 34 | }]; 35 | } 36 | 37 | oneof kind { 38 | GlobalSignal global_signal = 2; 39 | PersonaSignal persona_signal = 3; 40 | } 41 | } 42 | 43 | // GlobalSignal indicates that everything should be scheduled for a 44 | // refresh. 45 | // 46 | // It is reserved more more extreme edge cases, such as when an account 47 | // may be inactive for an extended period of time, and their log is 48 | // getting significantly full. The sending of a GlobalSignal is therefore 49 | // restricted to a whitelisted set of signaler's, enforced by the Signaler 50 | // service. 51 | message GlobalSignal { 52 | } 53 | 54 | message PersonaSignal { 55 | // If persona_id is set, then only the specified persona should be updated. 56 | // If persona_id is not set, then all personas should be updated. 57 | common.v2.PersonaId persona_id = 1 [(kik.validation.field_validation) = { 58 | mandatory: false 59 | }]; 60 | } 61 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/badgecount/v1/badge_count_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.badgecount.v1; 4 | 5 | option java_package = "com.kik.badgecount.rpc"; 6 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/badgecount/v1;badgecount"; 7 | 8 | import "common_model.proto"; 9 | import "common_rpc.proto"; 10 | import "protobuf_validation.proto"; 11 | 12 | // The badge count service is designed to allow the client to communicate its unread conversation state back to 13 | // the server. For various complexity and performance reasons across critical message paths, The server is unlikely 14 | // to be able to determine the badge counter as calculated by the client with 100% accuracy, so by having the 15 | // client report it's state, the server can self-correct its conversation state and report more accurate badge 16 | // counters in the future. 17 | service BadgeCount { 18 | 19 | // This is called to synchronize the server's internal "unread conversation" state. 20 | // Due to iOS limitations, the client can't reliably compare the last pushed badge counter with its actual 21 | // state, so SetUnreadConversations should be called whenever the client receives a non-empty QoS flush, 22 | // on the last batch of QoS pages to periodically synchronize the state, and provide some ability to 23 | // measure the reliability of the server's internal state. 24 | rpc SetUnreadConversations(SetUnreadConversationsRequest) returns (common.VoidResponse); 25 | } 26 | 27 | message SetUnreadConversationsRequest { 28 | // This should contain the entire set of unread conversations by jid 29 | // - IF the entire set of unread conversations exceeds max_repetitions, take the first 200 conversation buckets 30 | // as the client sees them. 31 | repeated common.XiBareUserOrGroupJid conversations_unread = 1 [(kik.validation.field_validation) = { 32 | mandatory: false 33 | // Bounding is necessary to avoid unbound-data-related performance issues. 200 is chosen as 99 is the max 34 | // badge count on the client, and this will reduce the frequency of incorrect badge counters for high badge 35 | // count clients. 36 | max_repetitions: 200 37 | }]; 38 | 39 | // this only differs from the size of conversations_unread when the actual number of unread conversations is larger 40 | // conversations_unread.max_repetitions 41 | uint32 unread_count = 2; 42 | } 43 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/visibility_rules_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/visibility_rules.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 15 | import kik_unofficial.protobuf.common.v1_pb2 as model 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%messagepath/v1/visibility_rules.proto\x12\x15\x63ommon.messagepath.v1\x1a\x12\x63ommon_model.proto\x1a\x15\x63ommon/v1/model.proto\x1a\x19protobuf_validation.proto\"\xbd\x02\n\x19VisibilityRulesAttachment\x12\x32\n\tinitiator\x18\x01 \x01(\x0b\x32\x15.common.XiBareUserJidB\x08\x18\x01\xca\x9d%\x02\x08\x00\x12\x38\n\x0cinitiator_v2\x18\x04 \x01(\x0b\x32\".common.v1.XiBareUserJidOrAliasJid\x12$\n\x1c\x64rop_if_initiator_not_friend\x18\x02 \x01(\x08\x12\x43\n\x04rule\x18\x03 \x01(\x0e\x32\x35.common.messagepath.v1.VisibilityRulesAttachment.Rule\"G\n\x04Rule\x12\x1d\n\x19USE_SENDER_FOR_VISIBILITY\x10\x00\x12 \n\x1cUSE_INITIATOR_FOR_VISIBILITY\x10\x01\x42z\n\x19\x63om.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\xa2\x02\x04MPTHb\x06proto3') 19 | 20 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 21 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.visibility_rules_pb2', globals()) 22 | if _descriptor._USE_C_DESCRIPTORS == False: 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\004MPTH' 26 | _VISIBILITYRULESATTACHMENT.fields_by_name['initiator']._options = None 27 | _VISIBILITYRULESATTACHMENT.fields_by_name['initiator']._serialized_options = b'\030\001\312\235%\002\010\000' 28 | _VISIBILITYRULESATTACHMENT._serialized_start=135 29 | _VISIBILITYRULESATTACHMENT._serialized_end=452 30 | _VISIBILITYRULESATTACHMENT_RULE._serialized_start=381 31 | _VISIBILITYRULESATTACHMENT_RULE._serialized_end=452 32 | # @@protoc_insertion_point(module_scope) 33 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/profile/v1/profile_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.profile.v1; 4 | 5 | option java_package = "com.kik.profile"; 6 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/profile/v1;profile"; 7 | 8 | import "entity/v1/element_common.proto"; 9 | 10 | // Kin User ID action 11 | message KinUserIdAction { 12 | Type action_type = 1; 13 | enum Type { 14 | SET = 0; 15 | UNSET = 1; 16 | } 17 | common.entity.v1.KinUserIdElement element_kin_user_id = 2; 18 | } 19 | 20 | // User/Group bio 21 | message BioAction { 22 | Type action_type = 1; 23 | enum Type { 24 | SET = 0; 25 | UNSET = 1; 26 | } 27 | common.entity.v1.BioElement element_bio = 2; 28 | } 29 | 30 | // Original Profile Pic Extension 31 | message OriginalProfilePicExtensionAction { 32 | Type action_type = 1; 33 | enum Type { 34 | SET = 0; 35 | UNSET = 1; 36 | } 37 | common.entity.v1.OriginalProfilePicExtensionElement original_profile_pic_extension = 2; 38 | } 39 | 40 | // Background Pic Extension 41 | message BackgroundProfilePicExtensionAction { 42 | Type action_type = 1; 43 | enum Type { 44 | SET = 0; 45 | UNSET = 1; 46 | } 47 | common.entity.v1.BackgroundProfilePicExtensionElement background_profile_pic_extension = 2; 48 | } 49 | 50 | // Anon Match Avatar 51 | message AnonMatchAvatarAction { 52 | Type action_type = 1; 53 | enum Type { 54 | SET = 0; 55 | UNSET = 1; 56 | } 57 | 58 | common.entity.v1.AnonMatchAvatarElement element_avatar = 2; 59 | } 60 | 61 | message EmojiStatusAction { 62 | Type action_type = 1; 63 | enum Type { 64 | SET = 0; 65 | UNSET = 1; 66 | } 67 | 68 | common.entity.v1.EmojiStatusElement element_emoji_status = 2; 69 | } 70 | 71 | message InterestsAction { 72 | Type action_type = 1; 73 | enum Type { 74 | SET = 0; 75 | UNSET = 1; 76 | } 77 | 78 | common.entity.v1.InterestsElement interests = 2; 79 | } 80 | 81 | // Chat themes 82 | message ChatThemeAction { 83 | Type action_type = 1; 84 | enum Type { 85 | SET = 0; 86 | UNSET = 1; 87 | } 88 | 89 | common.entity.v1.ChatThemeElement element_chat_theme = 2; 90 | } 91 | 92 | message ChatThemeLockAction { 93 | Type action_type = 1; 94 | enum Type { 95 | SET = 0; 96 | UNSET = 1; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /kik_unofficial/http_requests/content.py: -------------------------------------------------------------------------------- 1 | import hashlib 2 | import logging 3 | import requests 4 | from threading import Thread 5 | 6 | from kik_unofficial.datatypes.exceptions import KikUploadError 7 | from kik_unofficial.datatypes.xmpp.chatting import OutgoingChatImage 8 | from kik_unofficial.utilities.cryptographic_utilities import CryptographicUtils 9 | from kik_unofficial.device_configuration import kik_version_info 10 | 11 | 12 | log = logging.getLogger("kik_unofficial") 13 | SALT = "YA=57aSA!ztajE5" 14 | 15 | 16 | def upload_gallery_image(outgoing_chat_image: OutgoingChatImage, jid, username, password): 17 | url = f"https://platform.kik.com/content/files/{outgoing_chat_image.content_id}" 18 | send(url, outgoing_chat_image, jid, username, password) 19 | 20 | 21 | def send(url, image, jid, username, password): 22 | username_passkey = CryptographicUtils.key_from_password(username, password) 23 | app_id = "com.kik.ext.gallery" 24 | v = SALT + image.content_id + app_id 25 | 26 | verification = hashlib.sha1(v.encode("UTF-8")).hexdigest() 27 | headers = { 28 | "Host": "platform.kik.com", 29 | "Connection": "Keep-Alive", 30 | "Content-Length": str(image.parsed["size"]), 31 | "User-Agent": f'Kik/{kik_version_info["kik_version"]} (Android 7.1.2) Content', 32 | "x-kik-jid": jid, 33 | "x-kik-password": username_passkey, 34 | "x-kik-verification": verification, 35 | "x-kik-app-id": app_id, 36 | "x-kik-content-chunks": "1", 37 | "x-kik-content-size": str(image.parsed["size"]), 38 | "x-kik-content-md5": image.parsed["MD5"], 39 | "x-kik-chunk-number": "0", 40 | "x-kik-chunk-md5": image.parsed["MD5"], 41 | "x-kik-sha1-original": image.parsed["SHA1"].upper(), 42 | "x-kik-sha1-scaled": image.parsed["SHA1Scaled"].upper(), 43 | "x-kik-blockhash-scaled": image.parsed["blockhash"].upper(), 44 | "Content-Type": "image/jpeg", 45 | "x-kik-content-extension": ".jpg", 46 | } 47 | # Sometimes Kik's servers throw 5xx when they're having issues, the new thread won't handle the exception 48 | Thread(target=content_upload_thread, args=(url, image.parsed["original"], headers), name="KikContent").start() 49 | 50 | 51 | def content_upload_thread(url, image, headers): 52 | log.debug("Uploading Image") 53 | r = requests.put(url, data=image, headers=headers) 54 | if r.status_code != 200: 55 | raise KikUploadError(r.status_code, r.reason) 56 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/antispam/iospushverification/v1/iospushverification_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.antispam.iospushverification.v1; 4 | option java_package = "com.kik.antispam.iospushverification.rpc"; 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/antispam/iospushverification/v1;iospushverification"; 6 | 7 | import "protobuf_validation.proto"; 8 | 9 | // iOS push verification is a service that aims to verify the authenticity of an alleged iOS client through their 10 | // ability to receive an invisible VoIP push and echo it back to our backend. 11 | // 12 | // The service works as follows: 13 | // 1. authenticated stream: 14 | // when a client receives a TriggerSendVoipPushToken request, they submit their push token via a call to 15 | // SubmitVoipPushToken 16 | // anonymous stream: 17 | // client immediately calls SubmitVoipPushToken on bind 18 | // 2. client will receive a VoIP push notification from the verification backend 19 | // 3. upon receiving the VoIP push notification, the client should send back the payload to the IosPushVerification 20 | // service via a call to ForwardPushPayload 21 | service IosPushVerification { 22 | // submit a VoIP push token to enter the verification flow 23 | rpc SubmitVoipPushToken (SubmitVoipPushTokenRequest) returns (SubmitVoipPushTokenResponse) { 24 | } 25 | 26 | // upon receiving a VoIP push notification with a verification payload, forward the payload to verify that 27 | // it was received 28 | rpc ForwardPushPayload (ForwardPushPayloadRequest) returns (ForwardPushPayloadResponse) { 29 | } 30 | } 31 | 32 | message SubmitVoipPushTokenRequest { 33 | // the VoIP push token that will be used to send a notification to the client for the sake of verification 34 | string token = 1 [(kik.validation.field_validation) = { 35 | min_byte_length: 1 36 | max_byte_length: 255 37 | }]; 38 | } 39 | 40 | message SubmitVoipPushTokenResponse { 41 | Result result = 1; 42 | enum Result { 43 | OK = 0; 44 | } 45 | } 46 | 47 | message ForwardPushPayloadRequest { 48 | // the payload that the client received via a VoIP push notification 49 | string payload = 1 [(kik.validation.field_validation) = { 50 | mandatory: true 51 | min_byte_length: 1 52 | max_byte_length: 25000 53 | }]; 54 | } 55 | 56 | message ForwardPushPayloadResponse { 57 | Result result = 1; 58 | enum Result { 59 | OK = 0; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/accounts/v1/user_info_shared.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.accounts.v1; 4 | 5 | option java_package = "com.kik.accounts.model"; 6 | option java_outer_classname = "UserInfoSharedProto"; 7 | option java_multiple_files = true; 8 | option java_generate_equals_and_hash = true; 9 | 10 | option objc_class_prefix = "XIACC"; 11 | 12 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/accounts/v1;accounts"; 13 | 14 | import "protobuf_validation.proto"; 15 | 16 | // DisplayNameComponents are the components that make up a user's display name. 17 | // 18 | // The display name can be generated by concat(first_name, " ", last_name), 19 | // The display name components can be derived from a display name by splitting 20 | // on the first space. 21 | // 22 | // Spaces are allowed in the first and last name components, but this can cause 23 | // issues due to the way the components are derived from a display name 24 | // (i.e. split on the first space). 25 | message DisplayNameComponents { 26 | string first_name = 1 [(kik.validation.field_validation) = { 27 | mandatory: true 28 | max_byte_length: 255 29 | }]; 30 | 31 | string last_name = 2 [(kik.validation.field_validation) = { 32 | // Last name is optional to allow cases where we only 33 | // want a single name. An example use cases is bots. 34 | max_byte_length: 255 35 | }]; 36 | } 37 | 38 | // The enum values in this enum are +10 from the enum values 39 | // defined in kik-server. This is done because we don't want the 40 | // default value to be DISABLED_CONFIRMED. Additionally, the offset 41 | // between the two enum values must be large enough such that they 42 | // do not overlap. Otherwise, setting the value directly could result 43 | // in a status change (UNCONFIRMED may be serialized to CONFIRMED). 44 | // 45 | // Server definitions: https://github.com/kikinteractive/kik-server/blob/master/server/src/main/java/com/kik/utils/AccountUtils.java#L280 46 | // 47 | // Deactivated indicates that the account has been deactivated either by the user (recoverable) or 48 | // foricibly terminated by support (non-recoverable). Confirmed indicates that the user has confirmed their email. 49 | enum AccountStatus { 50 | UNSET = 0; 51 | 52 | DEACTIVATED_CONFIRMED = 10; // 0 + 10 53 | DEACTIVATED_UNCONFIRMED = 9; // -1 + 10 54 | UNCONFIRMED = 11; // 1 + 10 55 | CONFIRMED = 12; // 2 + 10 56 | } 57 | 58 | enum UserType { 59 | NORMAL = 0; 60 | TEST = 1; 61 | RAGEBOT = 2; 62 | } -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/google/protobuf/source_context.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option java_package = "com.google.protobuf"; 37 | option java_outer_classname = "SourceContextProto"; 38 | option java_multiple_files = true; 39 | option objc_class_prefix = "GPB"; 40 | option go_package = "google.golang.org/genproto/protobuf/source_context;source_context"; 41 | 42 | // `SourceContext` represents information about the source of a 43 | // protobuf element, like the file in which it is defined. 44 | message SourceContext { 45 | // The path-qualified name of the .proto file that contained the associated 46 | // protobuf element. For example: `"google/protobuf/source_context.proto"`. 47 | string file_name = 1; 48 | } 49 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/accounts/v1/user_info_shared_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: accounts/v1/user_info_shared.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"accounts/v1/user_info_shared.proto\x12\x12\x63ommon.accounts.v1\x1a\x19protobuf_validation.proto\"R\n\x15\x44isplayNameComponents\x12\x1d\n\nfirst_name\x18\x01 \x01(\tB\t\xca\x9d%\x05\x08\x01\x30\xff\x01\x12\x1a\n\tlast_name\x18\x02 \x01(\tB\x07\xca\x9d%\x03\x30\xff\x01*r\n\rAccountStatus\x12\t\n\x05UNSET\x10\x00\x12\x19\n\x15\x44\x45\x41\x43TIVATED_CONFIRMED\x10\n\x12\x1b\n\x17\x44\x45\x41\x43TIVATED_UNCONFIRMED\x10\t\x12\x0f\n\x0bUNCONFIRMED\x10\x0b\x12\r\n\tCONFIRMED\x10\x0c*-\n\x08UserType\x12\n\n\x06NORMAL\x10\x00\x12\x08\n\x04TEST\x10\x01\x12\x0b\n\x07RAGEBOT\x10\x02\x42\x8c\x01\n\x16\x63om.kik.accounts.modelB\x13UserInfoSharedProtoP\x01ZPgithub.com/kikinteractive/xiphias-model-common/generated/go/accounts/v1;accounts\xa0\x01\x01\xa2\x02\x05XIACCb\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'accounts.v1.user_info_shared_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\026com.kik.accounts.modelB\023UserInfoSharedProtoP\001ZPgithub.com/kikinteractive/xiphias-model-common/generated/go/accounts/v1;accounts\240\001\001\242\002\005XIACC' 25 | _DISPLAYNAMECOMPONENTS.fields_by_name['first_name']._options = None 26 | _DISPLAYNAMECOMPONENTS.fields_by_name['first_name']._serialized_options = b'\312\235%\005\010\0010\377\001' 27 | _DISPLAYNAMECOMPONENTS.fields_by_name['last_name']._options = None 28 | _DISPLAYNAMECOMPONENTS.fields_by_name['last_name']._serialized_options = b'\312\235%\0030\377\001' 29 | _ACCOUNTSTATUS._serialized_start=169 30 | _ACCOUNTSTATUS._serialized_end=283 31 | _USERTYPE._serialized_start=285 32 | _USERTYPE._serialized_end=330 33 | _DISPLAYNAMECOMPONENTS._serialized_start=85 34 | _DISPLAYNAMECOMPONENTS._serialized_end=167 35 | # @@protoc_insertion_point(module_scope) 36 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/abtesting/v1/ab_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.abtesting.v1; 4 | 5 | option java_package = "com.kik.abtesting.rpc"; 6 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/abtesting/v1;abtesting"; 7 | 8 | import "common_model.proto"; 9 | import "abtesting/v1/ab_testing_shared.proto"; 10 | import "protobuf_validation.proto"; 11 | 12 | //---------------------------------------------------------------------------- 13 | // Terminology 14 | //---------------------------------------------------------------------------- 15 | // 16 | // Experiment: Defines information about a particular AB test 17 | 18 | //---------------------------------------------------------------------------- 19 | // Service Interfaces 20 | //---------------------------------------------------------------------------- 21 | service AbTesting { 22 | // Returns the set of experiments a particular user is participating in. 23 | rpc GetParticipatingExperiments(GetExperimentsRequest) returns (GetExperimentsResponse) {} 24 | } 25 | 26 | //---------------------------------------------------------------------------- 27 | // Request/Response Types 28 | //---------------------------------------------------------------------------- 29 | 30 | message GetExperimentsRequest { 31 | // The jid for the user we are fetching experiments for 32 | // NOTE: "This will not be part of the request long term - the server bridge will send the jid as a GRPC header to service." - Dan 33 | common.XiBareUserJid jid = 1 [(kik.validation.field_validation) = { mandatory: true }]; 34 | 35 | // Set of service selected (and only service selected) Experiment's the user already knows it is in. 36 | // We *ARE NOT* including pre-registration selected experiments at this time. 37 | repeated common.abtesting.v1.Experiment participating_experiments = 2 [(kik.validation.field_validation) = { 38 | mandatory: false 39 | max_repetitions: 100 40 | }]; 41 | } 42 | 43 | message GetExperimentsResponse { 44 | // Set of Experiment's associated with the requested user 45 | repeated common.abtesting.v1.Experiment participating_experiments = 1; 46 | 47 | // Determines whether or not this response should direct clients to send the metrics update. 48 | // This should be TRUE in the majority of scenarios except for when there is a need to handle 49 | // client metrics load issues. 50 | // Specifically, this should be only used in overload scenarios to prevent heartbeats for users not in any 51 | // experiments. However it is technically possible to be used at any time. 52 | bool should_send_metrics_event = 2; 53 | } 54 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/google/protobuf/empty.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option go_package = "github.com/golang/protobuf/ptypes/empty"; 37 | option java_package = "com.google.protobuf"; 38 | option java_outer_classname = "EmptyProto"; 39 | option java_multiple_files = true; 40 | option objc_class_prefix = "GPB"; 41 | option cc_enable_arenas = true; 42 | 43 | // A generic empty message that you can re-use to avoid defining duplicated 44 | // empty messages in your APIs. A typical example is to use it as the request 45 | // or the response type of an API method. For instance: 46 | // 47 | // service Foo { 48 | // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 49 | // } 50 | // 51 | // The JSON representation for `Empty` is empty JSON object `{}`. 52 | message Empty {} 53 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/asset/v1/asset_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.asset.v1; 4 | 5 | option java_package = "com.kik.asset.model"; 6 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/asset/v1;asset"; 7 | 8 | import "protobuf_validation.proto"; 9 | 10 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 12 | // Common asset management service types for serving products to mobile clients 13 | 14 | // Contains the universal details of a product 15 | message ProductContent { 16 | // A map between the name of the asset and its content 17 | map assets = 1 [(kik.validation.map_key) = { 18 | min_byte_length: 1 19 | max_byte_length: 128 20 | }]; 21 | 22 | Type type = 2; 23 | 24 | enum Type { 25 | UNKNOWN = 0; 26 | CHAT_THEME = 1; 27 | AVATAR = 2; 28 | } 29 | } 30 | 31 | // Contains the content of an asset (a component of a product). This model should be used for retrieving existing 32 | // assets, not creating or updating them. media_content or simple_content (or both) must be set. 33 | message Asset { 34 | MediaContent media_content = 10; 35 | 36 | // The preview for the media content being presented (optional) 37 | MediaContent media_content_preview = 11; 38 | 39 | // If the asset is not a media object (e.g. a color hex code), its data will be stored in this map. The expected 40 | // max size for a value in simple_content is roughly 1024 bytes and there should be no more than 10 key-value pairs. 41 | map simple_content = 12 [(kik.validation.map_key) = { 42 | min_byte_length: 1 43 | max_byte_length: 64 44 | }]; 45 | } 46 | 47 | // Contains the details of a media component (e.g. image, video) of an asset 48 | message MediaContent { 49 | string content_url = 1 [(kik.validation.field_validation) = { 50 | min_byte_length: 1 51 | max_byte_length: 255 52 | }]; 53 | 54 | Mimetype mimetype = 2; 55 | enum Mimetype { 56 | UNKNOWN = 0; 57 | IMAGE_JPEG = 1; 58 | IMAGE_PNG = 2; 59 | }; 60 | } 61 | 62 | // Used to request assets of a specific pixel density from a service 63 | enum PixelDensity { 64 | NODPI = 0; 65 | ANDROID_LDPI = 1; 66 | ANDROID_MDPI = 2; 67 | ANDROID_HDPI = 3; 68 | ANDROID_XHDPI = 4; 69 | ANDROID_XXHDPI = 5; 70 | ANDROID_XXXHDPI = 6; 71 | IOS_X1 = 7; 72 | IOS_X2 = 8; 73 | IOS_X3 = 9; 74 | } 75 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_validation_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: protobuf_validation.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19protobuf_validation.proto\x12\x0ekik.validation\x1a google/protobuf/descriptor.proto\"\xf4\x02\n\x0f\x46ieldValidation\x12\x18\n\tmandatory\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\r\n\x05regex\x18\x02 \x01(\t\x12\x16\n\x0emin_codepoints\x18\x03 \x01(\x05\x12\x16\n\x0emax_codepoints\x18\x04 \x01(\x05\x12\x17\n\x0fmin_byte_length\x18\x05 \x01(\x05\x12\x17\n\x0fmax_byte_length\x18\x06 \x01(\x05\x12\x0f\n\x07min_val\x18\x07 \x01(\x10\x12\x0f\n\x07max_val\x18\x08 \x01(\x10\x12\x16\n\x0emin_double_val\x18\x0b \x01(\x01\x12\x16\n\x0emax_double_val\x18\x0c \x01(\x01\x12\x17\n\x0fmin_repetitions\x18\x0f \x01(\r\x12\x17\n\x0fmax_repetitions\x18\x10 \x01(\r\x12\x36\n\x07ordered\x18\x11 \x01(\x0e\x32%.kik.validation.FieldValidation.Order\"\x1a\n\x05Order\x12\x07\n\x03\x41SC\x10\x00\x12\x08\n\x04\x44\x45SC\x10\x01:Z\n\x10\x66ield_validation\x12\x1d.google.protobuf.FieldOptions\x18\xd9\xd3\x04 \x01(\x0b\x32\x1f.kik.validation.FieldValidation:Q\n\x07map_key\x12\x1d.google.protobuf.FieldOptions\x18\xda\xd3\x04 \x01(\x0b\x32\x1f.kik.validation.FieldValidationBl\n\x17\x63om.kik.protovalidationZQgithub.com/kikinteractive/xiphias-model-common/generated/go/kikoptions;kikoptions') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protobuf_validation_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(field_validation) 23 | google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(map_key) 24 | 25 | DESCRIPTOR._options = None 26 | DESCRIPTOR._serialized_options = b'\n\027com.kik.protovalidationZQgithub.com/kikinteractive/xiphias-model-common/generated/go/kikoptions;kikoptions' 27 | _FIELDVALIDATION._serialized_start=80 28 | _FIELDVALIDATION._serialized_end=452 29 | _FIELDVALIDATION_ORDER._serialized_start=426 30 | _FIELDVALIDATION_ORDER._serialized_end=452 31 | # @@protoc_insertion_point(module_scope) 32 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/abtesting/v1/ab_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: abtesting/v1/ab_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import common_model_pb2 as common__model__pb2 15 | import kik_unofficial.protobuf.abtesting.v1_pb2 as ab_testing_shared 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x61\x62testing/v1/ab_service.proto\x12\x13mobile.abtesting.v1\x1a\x12\x63ommon_model.proto\x1a$abtesting/v1/ab_testing_shared.proto\x1a\x19protobuf_validation.proto\"\x92\x01\n\x15GetExperimentsRequest\x12*\n\x03jid\x18\x01 \x01(\x0b\x32\x15.common.XiBareUserJidB\x06\xca\x9d%\x02\x08\x01\x12M\n\x19participating_experiments\x18\x02 \x03(\x0b\x32\x1f.common.abtesting.v1.ExperimentB\t\xca\x9d%\x05\x08\x00\x80\x01\x64\"\x7f\n\x16GetExperimentsResponse\x12\x42\n\x19participating_experiments\x18\x01 \x03(\x0b\x32\x1f.common.abtesting.v1.Experiment\x12!\n\x19should_send_metrics_event\x18\x02 \x01(\x08\x32\x85\x01\n\tAbTesting\x12x\n\x1bGetParticipatingExperiments\x12*.mobile.abtesting.v1.GetExperimentsRequest\x1a+.mobile.abtesting.v1.GetExperimentsResponse\"\x00\x42i\n\x15\x63om.kik.abtesting.rpcZPgithub.com/kikinteractive/xiphias-api-mobile/generated/go/abtesting/v1;abtestingb\x06proto3') 19 | 20 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 21 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'abtesting.v1.ab_service_pb2', globals()) 22 | if _descriptor._USE_C_DESCRIPTORS == False: 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\025com.kik.abtesting.rpcZPgithub.com/kikinteractive/xiphias-api-mobile/generated/go/abtesting/v1;abtesting' 26 | _GETEXPERIMENTSREQUEST.fields_by_name['jid']._options = None 27 | _GETEXPERIMENTSREQUEST.fields_by_name['jid']._serialized_options = b'\312\235%\002\010\001' 28 | _GETEXPERIMENTSREQUEST.fields_by_name['participating_experiments']._options = None 29 | _GETEXPERIMENTSREQUEST.fields_by_name['participating_experiments']._serialized_options = b'\312\235%\005\010\000\200\001d' 30 | _GETEXPERIMENTSREQUEST._serialized_start=140 31 | _GETEXPERIMENTSREQUEST._serialized_end=286 32 | _GETEXPERIMENTSRESPONSE._serialized_start=288 33 | _GETEXPERIMENTSRESPONSE._serialized_end=415 34 | _ABTESTING._serialized_start=418 35 | _ABTESTING._serialized_end=551 36 | # @@protoc_insertion_point(module_scope) 37 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/entity/v1/subscription_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: entity/v1/subscription_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.entity.v1_pb2 as entity_common 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#entity/v1/subscription_common.proto\x12\x10\x63ommon.entity.v1\x1a\x19protobuf_validation.proto\x1a\x1d\x65ntity/v1/entity_common.proto\x1a\x15\x63ommon/v1/model.proto\"/\n\x0fRosterSyncToken\x12\x1c\n\x07payload\x18\x01 \x01(\x0c\x42\x0b\xca\x9d%\x07\x08\x01(\x01\x30\x80(\"C\n\x0f\x41liasBlockEntry\x12\x30\n\talias_jid\x18\x01 \x01(\x0b\x32\x15.common.v1.XiAliasJidB\x06\xca\x9d%\x02\x08\x01\"\xf3\x01\n\x0bRosterEntry\x12<\n\tuser_data\x18\x01 \x01(\x0b\x32\'.common.entity.v1.EntityUserRosterEntryH\x00\x12>\n\ngroup_data\x18\x02 \x01(\x0b\x32(.common.entity.v1.EntityGroupRosterEntryH\x00\x12=\n\x10\x61lias_block_data\x18\x04 \x01(\x0b\x32!.common.entity.v1.AliasBlockEntryH\x00\x12\x12\n\nis_blocked\x18\x03 \x01(\x08\x42\x13\n\x11roster_entry_kindBn\n\x14\x63om.kik.entity.modelZLgithub.com/kikinteractive/xiphias-model-common/generated/go/entity/v1;entity\xa0\x01\x01\xa2\x02\x04SUBSb\x06proto3') 19 | 20 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 21 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'entity.v1.subscription_common_pb2', globals()) 22 | if _descriptor._USE_C_DESCRIPTORS == False: 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\024com.kik.entity.modelZLgithub.com/kikinteractive/xiphias-model-common/generated/go/entity/v1;entity\240\001\001\242\002\004SUBS' 26 | _ROSTERSYNCTOKEN.fields_by_name['payload']._options = None 27 | _ROSTERSYNCTOKEN.fields_by_name['payload']._serialized_options = b'\312\235%\007\010\001(\0010\200(' 28 | _ALIASBLOCKENTRY.fields_by_name['alias_jid']._options = None 29 | _ALIASBLOCKENTRY.fields_by_name['alias_jid']._serialized_options = b'\312\235%\002\010\001' 30 | _ROSTERSYNCTOKEN._serialized_start=138 31 | _ROSTERSYNCTOKEN._serialized_end=185 32 | _ALIASBLOCKENTRY._serialized_start=187 33 | _ALIASBLOCKENTRY._serialized_end=254 34 | _ROSTERENTRY._serialized_start=257 35 | _ROSTERENTRY._serialized_end=500 36 | # @@protoc_insertion_point(module_scope) 37 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/carousels_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/carousels.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 15 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 16 | import kik_unofficial.protobuf.messagepath.v1_pb2 as keyboards 17 | 18 | 19 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emessagepath/v1/carousels.proto\x12\x15\x63ommon.messagepath.v1\x1a\x12\x63ommon_model.proto\x1a\x19protobuf_validation.proto\x1a\x1emessagepath/v1/keyboards.proto\x1a!messagepath/v1/link_message.proto\"]\n\x19\x43\x61rouselMessageAttachment\x12@\n\x05items\x18\x01 \x03(\x0b\x32#.common.messagepath.v1.CarouselItemB\x0c\xca\x9d%\x08\x08\x01x\x01\x80\x01\xe8\x07\"{\n\x0c\x43\x61rouselItem\x12$\n\nmessage_id\x18\x01 \x01(\x0b\x32\x0e.common.XiUuidH\x00\x12=\n\x07\x63ontent\x18\x02 \x01(\x0b\x32*.common.messagepath.v1.CarouselItemContentH\x00\x42\x06\n\x04item\"\xb6\x01\n\x13\x43\x61rouselItemContent\x12\x46\n\x13keyboard_attachment\x18\x1e \x01(\x0b\x32).common.messagepath.v1.KeyboardAttachment\x12O\n\x17link_message_attachment\x18\x1f \x01(\x0b\x32,.common.messagepath.v1.LinkMessageAttachmentH\x00\x42\x06\n\x04typeBz\n\x19\x63om.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\xa2\x02\x04MPTHb\x06proto3') 20 | 21 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 22 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.carousels_pb2', globals()) 23 | if _descriptor._USE_C_DESCRIPTORS == False: 24 | 25 | DESCRIPTOR._options = None 26 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\004MPTH' 27 | _CAROUSELMESSAGEATTACHMENT.fields_by_name['items']._options = None 28 | _CAROUSELMESSAGEATTACHMENT.fields_by_name['items']._serialized_options = b'\312\235%\010\010\001x\001\200\001\350\007' 29 | _CAROUSELMESSAGEATTACHMENT._serialized_start=171 30 | _CAROUSELMESSAGEATTACHMENT._serialized_end=264 31 | _CAROUSELITEM._serialized_start=266 32 | _CAROUSELITEM._serialized_end=389 33 | _CAROUSELITEMCONTENT._serialized_start=392 34 | _CAROUSELITEMCONTENT._serialized_end=574 35 | # @@protoc_insertion_point(module_scope) 36 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/groups/v1/group_suggest_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.groups.v1; 4 | option java_package = "com.kik.groups"; 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/groups/v1;groups"; 6 | 7 | import "protobuf_validation.proto"; 8 | 9 | //---------------------------------------------------------------------------- 10 | // Service Interfaces 11 | //---------------------------------------------------------------------------- 12 | 13 | // 14 | // Mobile-facing service to provide a curated set of "suggested search terms" 15 | // to be used to search for public groups. This will allow the kik clients to 16 | // provide an easily-updatable list of search suggestions to the user. 17 | // 18 | service GroupSuggest { 19 | // Provides a set of suggested group search terms 20 | // Notes: 21 | // * Terms ordering: This method makes no guarantees as to the order of the suggested terms 22 | // provided. While unlikely, the order may appear different from one request to the next. 23 | // * Response size: This method will return as many as 100 suggestions. If the list is too large for display, 24 | // the client is expected to arbitrarily (or randomly) select a subset from this list. 25 | // * Rate Limiting: This method will be rate limited. The expectation is no more than 1 call per minute 26 | // per active client. 27 | // 28 | rpc GetSuggestedGroupSearchTerms(GetSuggestedGroupSearchTermsRequest) returns (GetSuggestedGroupSearchTermsResponse) {} 29 | } 30 | 31 | //---------------------------------------------------------------------------- 32 | // Request/Response Types 33 | //---------------------------------------------------------------------------- 34 | 35 | message GetSuggestedGroupSearchTermsRequest { 36 | } 37 | 38 | message GetSuggestedGroupSearchTermsResponse { 39 | Result result = 1; 40 | enum Result { 41 | OK = 0; 42 | RATE_LIMIT_EXCEEDED = 1; 43 | } 44 | 45 | repeated SuggestedTerm suggested_term = 2 [(kik.validation.field_validation) = { 46 | mandatory: false 47 | max_repetitions: 100 48 | }]; 49 | message SuggestedTerm { 50 | // A simple string intended as a search term that may be presented to 51 | // the user as a suggestion to use when searching for groups. If 52 | // selected, this term should be provided to the group search service 53 | // as-is. 54 | // Note these terms will not have a '#' character prefix, nor any special 55 | // wildcards. (there are no wildcards included in the spec at this time) 56 | string term = 1 [(kik.validation.field_validation) = { 57 | mandatory: true 58 | regex: "^[A-Za-z0-9._]{1,32}$" 59 | }]; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/push/v2/push_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: push/v2/push_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19push/v2/push_common.proto\x12\x0e\x63ommon.push.v2\x1a\x19protobuf_validation.proto\"\x9d\x03\n\tPushToken\x12H\n\x12\x61ndroid_push_token\x18\x01 \x01(\x0b\x32*.common.push.v2.PushToken.AndroidPushTokenH\x00\x12@\n\x0eios_push_token\x18\x02 \x01(\x0b\x32&.common.push.v2.PushToken.IosPushTokenH\x00\x1a,\n\x10\x41ndroidPushToken\x12\x18\n\x05token\x18\x01 \x01(\tB\t\xca\x9d%\x05\x08\x01\x30\x80\x08\x1a\xcd\x01\n\x0cIosPushToken\x12\x18\n\x05token\x18\x01 \x01(\tB\t\xca\x9d%\x05\x08\x01\x30\x80\x08\x12\x39\n\x04type\x18\x02 \x01(\x0e\x32+.common.push.v2.PushToken.IosPushToken.Type\"h\n\x04Type\x12\x17\n\x13\x41PPSTORE_PRODUCTION\x10\x00\x12\x14\n\x10\x41PPSTORE_SANDBOX\x10\x01\x12\x19\n\x15\x45NTERPRISE_PRODUCTION\x10\x02\x12\x16\n\x12\x45NTERPRISE_SANDBOX\x10\x03\x42\x06\n\x04kindBq\n\x13\x63om.kik.gen.push.v2ZHgithub.com/kikinteractive/xiphias-model-common/generated/go/push/v2;push\xa2\x02\x0fKPBCommonPushV2b\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'push.v2.push_common_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\023com.kik.gen.push.v2ZHgithub.com/kikinteractive/xiphias-model-common/generated/go/push/v2;push\242\002\017KPBCommonPushV2' 25 | _PUSHTOKEN_ANDROIDPUSHTOKEN.fields_by_name['token']._options = None 26 | _PUSHTOKEN_ANDROIDPUSHTOKEN.fields_by_name['token']._serialized_options = b'\312\235%\005\010\0010\200\010' 27 | _PUSHTOKEN_IOSPUSHTOKEN.fields_by_name['token']._options = None 28 | _PUSHTOKEN_IOSPUSHTOKEN.fields_by_name['token']._serialized_options = b'\312\235%\005\010\0010\200\010' 29 | _PUSHTOKEN._serialized_start=73 30 | _PUSHTOKEN._serialized_end=486 31 | _PUSHTOKEN_ANDROIDPUSHTOKEN._serialized_start=226 32 | _PUSHTOKEN_ANDROIDPUSHTOKEN._serialized_end=270 33 | _PUSHTOKEN_IOSPUSHTOKEN._serialized_start=273 34 | _PUSHTOKEN_IOSPUSHTOKEN._serialized_end=478 35 | _PUSHTOKEN_IOSPUSHTOKEN_TYPE._serialized_start=374 36 | _PUSHTOKEN_IOSPUSHTOKEN_TYPE._serialized_end=478 37 | # @@protoc_insertion_point(module_scope) 38 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/client/v2/client_meta_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: client/v2/client_meta.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.kik_options_pb2 as kik__options__pb2 15 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 16 | import kik_unofficial.protobuf.common.v2_pb2 as model 17 | 18 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 19 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'client.v2.client_meta_pb2', globals()) 20 | if _descriptor._USE_C_DESCRIPTORS == False: 21 | 22 | DESCRIPTOR._options = None 23 | DESCRIPTOR._serialized_options = b'\n\034com.kik.gen.common.client.v2B\020ClientModelProtoP\001ZLgithub.com/kikinteractive/xiphias-model-common/generated/go/client/v2;client\240\001\001\242\002\022KPBCCommonClientV2\252\243*\002\010\001' 24 | _DEVICEDETAILS.fields_by_name['client_id']._options = None 25 | _DEVICEDETAILS.fields_by_name['client_id']._serialized_options = b'\312\235%\002\010\001' 26 | _CLIENTVERSION.fields_by_name['major']._options = None 27 | _CLIENTVERSION.fields_by_name['major']._serialized_options = b'\312\235%\0229\001\000\000\000\000\000\000\000A\000\000\000\200\000\000\000\000' 28 | _CLIENTVERSION.fields_by_name['minor']._options = None 29 | _CLIENTVERSION.fields_by_name['minor']._serialized_options = b'\312\235%\tA\000\000\000\200\000\000\000\000' 30 | _CLIENTVERSION.fields_by_name['bugfix']._options = None 31 | _CLIENTVERSION.fields_by_name['bugfix']._serialized_options = b'\312\235%\tA\000\000\000\200\000\000\000\000' 32 | _CLIENTVERSION.fields_by_name['build']._options = None 33 | _CLIENTVERSION.fields_by_name['build']._serialized_options = b'\312\235%\0020\n' 34 | _CLIENTVERSION.fields_by_name['dev_build']._options = None 35 | _CLIENTVERSION.fields_by_name['dev_build']._serialized_options = b'\312\235%\0020\n' 36 | _CLIENTLOCALE.fields_by_name['locale']._options = None 37 | _CLIENTLOCALE.fields_by_name['locale']._serialized_options = b'\312\235%-\022+^(?i)[a-z]{2,8}(?:_([a-z]{2}|[0-9]{2,3}))?$' 38 | _DEVICEDETAILS._serialized_start=119 39 | _DEVICEDETAILS._serialized_end=301 40 | _DEVICEDETAILS_DEVICETYPE._serialized_start=257 41 | _DEVICEDETAILS_DEVICETYPE._serialized_end=301 42 | _CLIENTVERSION._serialized_start=304 43 | _CLIENTVERSION._serialized_end=469 44 | _CLIENTLOCALE._serialized_start=471 45 | _CLIENTLOCALE._serialized_end=552 46 | # @@protoc_insertion_point(module_scope) 47 | -------------------------------------------------------------------------------- /kik_unofficial/http_requests/profile_pictures.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import io 4 | import logging 5 | import os 6 | import pathlib 7 | from threading import Thread 8 | from typing import Mapping 9 | 10 | import requests 11 | from kik_unofficial.device_configuration import kik_version_info 12 | from kik_unofficial.datatypes.exceptions import KikApiException, KikUploadError 13 | from kik_unofficial.utilities.cryptographic_utilities import CryptographicUtils 14 | from kik_unofficial.utilities.parsing_utilities import get_file_bytes 15 | 16 | log = logging.getLogger("kik_unofficial") 17 | 18 | BASE_URL = "https://profilepicsup.kik.com/profilepics" 19 | 20 | 21 | def set_profile_picture(file: str or bytes or pathlib.Path or io.IOBase, jid: str, username: str, password: str): 22 | send(BASE_URL, file, jid, username, password) 23 | 24 | 25 | def set_background_picture(file: str or bytes or pathlib.Path or io.IOBase, jid: str, username: str, password: str): 26 | url = f"{BASE_URL}?extension_type=BACKGROUND" 27 | send(url, file, jid, username, password) 28 | 29 | 30 | def set_group_picture(file: str or bytes or pathlib.Path or io.IOBase, user_jid: str, group_jid: str, username: str, password: str, silent: bool = False): 31 | url = f"{BASE_URL}?g={group_jid}" 32 | if silent: 33 | url += "&silent=1" 34 | send(url, file, user_jid, username, password) 35 | 36 | 37 | def send(url: str, file: str or bytes or pathlib.Path or io.IOBase, jid: str, username: str, password: str): 38 | if not os.path.isfile(file): 39 | raise KikApiException("File doesn't exist") 40 | headers = { 41 | "x-kik-jid": jid, 42 | "x-kik-password": CryptographicUtils.key_from_password(username, password), 43 | "User-Agent": f'Kik/{kik_version_info["kik_version"]} (Android 7.1.2) Dalvik/2.1.0 (Linux; U; Android 7.1.2; Nexus 7 Build/NJH47F)', 44 | } 45 | Thread(target=picture_upload_thread, args=(url, file, headers), name="KikProfilePics").start() 46 | 47 | 48 | def picture_upload_thread(url: str, file: str or bytes or pathlib.Path or io.IOBase, headers: Mapping[str, str | bytes]): 49 | picture_data = get_file_bytes(file) 50 | log.debug("Uploading picture") 51 | 52 | # Profile picture uploads can fail without a known cause. 53 | # Retry up to 3 times. 54 | max_retries = 3 55 | 56 | for retry_number in range(max_retries): 57 | r = requests.post(url, data=picture_data, headers=headers) 58 | if r.status_code == 200: 59 | if retry_number == max_retries - 1: 60 | raise KikUploadError(r.status_code, r.reason) 61 | else: 62 | log.warning("Uploading picture failed with %s, executing retry (%s/%s)", r.status_code, retry_number + 1, max_retries) 63 | else: 64 | log.debug("Uploading picture succeeded") 65 | return 66 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/common_rpc_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: common_rpc.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 15 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 16 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 17 | import kik_unofficial.protobuf.kik_options_pb2 as kik__options__pb2 18 | 19 | 20 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x63ommon_rpc.proto\x12\x06\x63ommon\x1a google/protobuf/descriptor.proto\x1a\x19protobuf_validation.proto\x1a\x12\x63ommon_model.proto\x1a\x11kik_options.proto\"\r\n\x0bVoidRequest\"\x0e\n\x0cVoidResponse\"1\n\x0bXiRequestId\x12\"\n\x02id\x18\x01 \x01(\x0b\x32\x0e.common.XiUuidB\x06\xca\x9d%\x02\x08\x01\"*\n\x0eXiRoutingToken\x12\x18\n\x05token\x18\x01 \x01(\tB\t\xca\x9d%\x05(\x01\x30\x80\x01\"\x85\x01\n\x15SelfDescribingMessage\x12@\n\x14\x66ield_descriptor_set\x18\x01 \x01(\x0b\x32\".google.protobuf.FileDescriptorSet\x12\x14\n\x0cmessage_name\x18\x02 \x01(\t\x12\x14\n\x0cmessage_data\x18\x03 \x01(\x0c\x42q\n\x13\x63om.kik.xiphias.rpcB\x0e\x43ommonRpcProtoP\x01ZBgithub.com/kikinteractive/xiphias-model-common/generated/go;common\xaa\xa3*\x02\x10\x01\x62\x06proto3') 21 | 22 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 23 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'common_rpc_pb2', globals()) 24 | if _descriptor._USE_C_DESCRIPTORS == False: 25 | 26 | DESCRIPTOR._options = None 27 | DESCRIPTOR._serialized_options = b'\n\023com.kik.xiphias.rpcB\016CommonRpcProtoP\001ZBgithub.com/kikinteractive/xiphias-model-common/generated/go;common\252\243*\002\020\001' 28 | _XIREQUESTID.fields_by_name['id']._options = None 29 | _XIREQUESTID.fields_by_name['id']._serialized_options = b'\312\235%\002\010\001' 30 | _XIROUTINGTOKEN.fields_by_name['token']._options = None 31 | _XIROUTINGTOKEN.fields_by_name['token']._serialized_options = b'\312\235%\005(\0010\200\001' 32 | _VOIDREQUEST._serialized_start=128 33 | _VOIDREQUEST._serialized_end=141 34 | _VOIDRESPONSE._serialized_start=143 35 | _VOIDRESPONSE._serialized_end=157 36 | _XIREQUESTID._serialized_start=159 37 | _XIREQUESTID._serialized_end=208 38 | _XIROUTINGTOKEN._serialized_start=210 39 | _XIROUTINGTOKEN._serialized_end=252 40 | _SELFDESCRIBINGMESSAGE._serialized_start=255 41 | _SELFDESCRIBINGMESSAGE._serialized_end=388 42 | # @@protoc_insertion_point(module_scope) 43 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/video/v1/kik_video_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: video/v1/kik_video_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.common_rpc_pb2 as common__rpc__pb2 16 | import kik_unofficial.protobuf.video.v1_pb2 as video_common 17 | 18 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 19 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'video.v1.kik_video_service_pb2', globals()) 20 | if _descriptor._USE_C_DESCRIPTORS == False: 21 | 22 | DESCRIPTOR._options = None 23 | DESCRIPTOR._serialized_options = b'\n\024com.kik.video.mobileZHgithub.com/kikinteractive/xiphias-api-mobile/generated/go/video/v1;video' 24 | _BATCHEDGETCONVOSTATEREQUEST.fields_by_name['convo_ids']._options = None 25 | _BATCHEDGETCONVOSTATEREQUEST.fields_by_name['convo_ids']._serialized_options = b'\312\235%\007\010\001x\001\200\001\024' 26 | _BATCHEDGETCONVOSTATERESPONSE.fields_by_name['latest_states']._options = None 27 | _BATCHEDGETCONVOSTATERESPONSE.fields_by_name['latest_states']._serialized_options = b'\312\235%\005\010\000\200\001\024' 28 | _JOINCONVOCONFERENCEREQUEST.fields_by_name['convo_id']._options = None 29 | _JOINCONVOCONFERENCEREQUEST.fields_by_name['convo_id']._serialized_options = b'\312\235%\002\010\001' 30 | _LEAVECONVOCONFERENCENOTIFICATION.fields_by_name['convo_id']._options = None 31 | _LEAVECONVOCONFERENCENOTIFICATION.fields_by_name['convo_id']._serialized_options = b'\312\235%\002\010\001' 32 | _BATCHEDGETCONVOSTATEREQUEST._serialized_start=127 33 | _BATCHEDGETCONVOSTATEREQUEST._serialized_end=214 34 | _BATCHEDGETCONVOSTATERESPONSE._serialized_start=217 35 | _BATCHEDGETCONVOSTATERESPONSE._serialized_end=403 36 | _BATCHEDGETCONVOSTATERESPONSE_RESULT._serialized_start=387 37 | _BATCHEDGETCONVOSTATERESPONSE_RESULT._serialized_end=403 38 | _JOINCONVOCONFERENCEREQUEST._serialized_start=405 39 | _JOINCONVOCONFERENCEREQUEST._serialized_end=491 40 | _JOINCONVOCONFERENCERESPONSE._serialized_start=494 41 | _JOINCONVOCONFERENCERESPONSE._serialized_end=832 42 | _JOINCONVOCONFERENCERESPONSE_RESULT._serialized_start=789 43 | _JOINCONVOCONFERENCERESPONSE_RESULT._serialized_end=832 44 | _LEAVECONVOCONFERENCENOTIFICATION._serialized_start=835 45 | _LEAVECONVOCONFERENCENOTIFICATION._serialized_end=1004 46 | _KIKVIDEO._serialized_start=1007 47 | _KIKVIDEO._serialized_end=1347 48 | # @@protoc_insertion_point(module_scope) 49 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/entity/v1/subscription_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.entity.v1; 4 | option java_package = "com.kik.entity.subscription.mobile"; 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/entity/v1;entity"; 6 | 7 | import "protobuf_validation.proto"; 8 | 9 | import "entity/v1/subscription_common.proto"; 10 | 11 | //---------------------------------------------------------------------------- 12 | // Mobile Facing Service 13 | //---------------------------------------------------------------------------- 14 | 15 | service Subscription { 16 | 17 | //====================================================================================== 18 | // Synchronize my roster's limited profile data (RosterEntry) to client. 19 | // This call will return a page of up to 500 roster profile data at a time with indication 20 | // more is available. 21 | // Oldest roster entry changes will be returned first. 22 | // 23 | // Client should: 24 | // 1. Omit token in request for full roster fetch 25 | // 2. Cache reponse.token after each successful call. 26 | // 3. while (response.has_more) { continue pull with new token from previous call }. 27 | //====================================================================================== 28 | 29 | // NOTE: SyncMyRosterData pulls a page at a time, so time fudging should be applied for 30 | // the first page call, subsequent pull should use the actual ts in the RosterSyncToken 31 | // How to tell if it is subsequent pull? Hide has_more in the token for this. 32 | // 33 | // NOTE; token should have two ts one for regular subscription and one for mega. 34 | rpc SyncMyRosterData(SyncMyRosterDataRequest) returns (SyncMyRosterDataResponse); 35 | 36 | } 37 | 38 | message SyncMyRosterDataRequest { 39 | 40 | // Encoded information returned by server for every SyncMyRosterData call. 41 | // This token contains information for the following purpose: 42 | // - validate the request 43 | // - parameters used in roster change time scanning 44 | 45 | common.entity.v1.RosterSyncToken token = 1; 46 | 47 | } 48 | 49 | message SyncMyRosterDataResponse { 50 | 51 | Result result = 1; 52 | enum Result { 53 | OK = 0; 54 | NOT_ALLOWED = 1; // Token inconsistent with info on server 55 | DELAYED = 2; // Roster data is not ready, client should delay for 10 mins and try again. 56 | } 57 | 58 | // Roster data returned in batches up to 500 or 100KiB (protobuf serialized) 59 | repeated common.entity.v1.RosterEntry roster_data = 2 [(kik.validation.field_validation) = { 60 | max_repetitions: 500 // sanity bound 61 | }]; 62 | 63 | // New token to be used in subsequent call. 64 | common.entity.v1.RosterSyncToken token = 3; 65 | 66 | // Simply indicate the client should continue to pull with token above 67 | bool has_more = 4; 68 | } 69 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/messagepath/v1/widgets.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package common.messagepath.v1; 4 | 5 | option java_package = "com.kik.messagepath.model"; 6 | option objc_class_prefix = "MPTH"; 7 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath"; 8 | 9 | import "common_model.proto"; 10 | import "protobuf_validation.proto"; 11 | import "messagepath/v1/keyboards.proto"; 12 | 13 | // WidgetAttachment defines the mechanism that allow bots to alter the behavior of dynamic 14 | // content that supplements the chatbot experience. 15 | // 16 | // Specifying a Widget allows a bot to give the user additional information that provides 17 | // more context to a conversation. TextWidget is an example of a widget that stays at the 18 | // top of the screen, providing persistent information all users in a conversation. 19 | // 20 | // Up to 51 of these may be present in a single message to be delivered. The case where this can 21 | // occur is in the case of a bot responding to a mention in a group containing 50 individuals, and 22 | // also having a default. 23 | // 24 | // If a client receives multiple widgets in this list directed at a single user, the first one 25 | // should be taken as the one to display. Support for displaying multiple widgets may be added in 26 | // the future. 27 | // 28 | // See: https://docs.google.com/a/kik.com/document/d/1Y2tnA5KfCma0wmGoqnoqFKWTJZa-beU0mvU3v8A3UN0/edit 29 | message WidgetAttachment { 30 | repeated Widget widgets = 1 [(kik.validation.field_validation) = { 31 | mandatory: true 32 | min_repetitions: 1 33 | max_repetitions: 1000 34 | }]; 35 | } 36 | 37 | message Widget { 38 | // The user that will receive this particular Widget instance. 39 | // 40 | // In the event that this field is omitted, this widget should be sent to all users that will 41 | // receive the message containing this widget. 42 | XiBareUserJid to = 1 [(kik.validation.field_validation) = { 43 | mandatory: false 44 | }]; 45 | 46 | oneof type { 47 | TextWidget text_widget = 32; 48 | } 49 | } 50 | 51 | // TextWidget allow bots to provide text to be shown at the top of the 52 | // conversation window. 53 | message TextWidget { 54 | string body = 1 [(kik.validation.field_validation) = { 55 | mandatory: true 56 | min_byte_length: 1 57 | max_byte_length: 1000 58 | }]; 59 | 60 | string title = 2 [(kik.validation.field_validation) = { 61 | mandatory: false 62 | max_byte_length: 1000 63 | }]; 64 | 65 | // You can attach a Keyboard to a TextWidget, which specifies 66 | // the keyboard to be shown when a reply button is pressed on the widget 67 | // 68 | // The `to` field of this Keyboard is ignored and overrided by the 69 | // `to` field of the widget 70 | Keyboard keyboard = 3 [(kik.validation.field_validation) = { 71 | mandatory: false 72 | }]; 73 | } 74 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/kin/payment/v1/payment_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: kin/payment/v1/payment_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#kin/payment/v1/payment_common.proto\x12\x15\x63ommon.kin.payment.v1\x1a\x19protobuf_validation.proto\x1a\x12\x63ommon_model.proto\"\xb6\x01\n\x0bPaymentInfo\x12/\n\x07\x66\x65\x61ture\x18\x01 \x01(\x0e\x32\x1e.common.kin.payment.v1.Feature\x12\x38\n\x0c\x66\x65\x61ture_data\x18\x02 \x01(\x0b\x32\".common.kin.payment.v1.FeatureData\x12<\n\nkin_amount\x18\x03 \x01(\x0b\x32 .common.kin.payment.v1.KinAmountB\x06\xca\x9d%\x02\x08\x01\"l\n\x0b\x46\x65\x61tureData\x12U\n\x1bpublic_group_admin_tip_data\x18\x01 \x01(\x0b\x32..common.kin.payment.v1.PublicGroupAdminTipDataH\x00\x42\x06\n\x04kind\"D\n\x17PublicGroupAdminTipData\x12)\n\x05group\x18\x01 \x01(\x0b\x32\x12.common.XiGroupJidB\x06\xca\x9d%\x02\x08\x01\"\x1b\n\tKinAmount\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x01*2\n\x07\x46\x65\x61ture\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x1a\n\x16PUBLIC_GROUP_ADMIN_TIP\x10\x01\x42o\n\x19\x63om.kik.kin.payment.modelZRgithub.com/kikinteractive/xiphias-model-common/generated/go/kin/payment/v1;paymentb\x06proto3') 19 | 20 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 21 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kin.payment.v1.payment_common_pb2', globals()) 22 | if _descriptor._USE_C_DESCRIPTORS == False: 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\031com.kik.kin.payment.modelZRgithub.com/kikinteractive/xiphias-model-common/generated/go/kin/payment/v1;payment' 26 | _PAYMENTINFO.fields_by_name['kin_amount']._options = None 27 | _PAYMENTINFO.fields_by_name['kin_amount']._serialized_options = b'\312\235%\002\010\001' 28 | _PUBLICGROUPADMINTIPDATA.fields_by_name['group']._options = None 29 | _PUBLICGROUPADMINTIPDATA.fields_by_name['group']._serialized_options = b'\312\235%\002\010\001' 30 | _FEATURE._serialized_start=503 31 | _FEATURE._serialized_end=553 32 | _PAYMENTINFO._serialized_start=110 33 | _PAYMENTINFO._serialized_end=292 34 | _FEATUREDATA._serialized_start=294 35 | _FEATUREDATA._serialized_end=402 36 | _PUBLICGROUPADMINTIPDATA._serialized_start=404 37 | _PUBLICGROUPADMINTIPDATA._serialized_end=472 38 | _KINAMOUNT._serialized_start=474 39 | _KINAMOUNT._serialized_end=501 40 | # @@protoc_insertion_point(module_scope) 41 | -------------------------------------------------------------------------------- /examples/register_client.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import logging 5 | import yaml 6 | 7 | from kik_unofficial.client import KikClient 8 | from kik_unofficial.callbacks import KikClientCallback 9 | from kik_unofficial.datatypes.xmpp.errors import SignUpError 10 | from kik_unofficial.datatypes.xmpp.roster import FetchRosterResponse 11 | from kik_unofficial.datatypes.xmpp.login import LoginResponse 12 | from kik_unofficial.datatypes.xmpp.sign_up import RegisterResponse 13 | from kik_unofficial.utilities.credential_utilities import random_device_id, random_android_id 14 | 15 | 16 | class RegisterClient(KikClientCallback): 17 | def on_sign_up_ended(self, response: RegisterResponse): 18 | print(f"Registered on node {response.kik_node}.") 19 | 20 | def on_authenticated(self): 21 | print("Authorized connection initiated.") 22 | client.request_roster() 23 | 24 | def on_login_ended(self, response: LoginResponse): 25 | print(f"Logged in as {response.username}.") 26 | 27 | def on_register_error(self, response: SignUpError): 28 | if "captcha_url" in dir(response): 29 | print(response.captcha_url) 30 | result = input("Captcha result:") 31 | client.register(args.email, args.username, args.password, 32 | args.firstname, args.lastname, args.birthday, result) 33 | else: 34 | print(f"Unable to register! error information:\r\n{response}") 35 | 36 | def on_roster_received(self, response: FetchRosterResponse): 37 | print(f"Friends: {response.peers}") 38 | 39 | 40 | if __name__ == '__main__': 41 | parser = argparse.ArgumentParser() 42 | parser.add_argument('username') 43 | parser.add_argument('email') 44 | parser.add_argument('-p', '--password') 45 | parser.add_argument('--firstname', default='Not A') 46 | parser.add_argument('--lastname', default='Human') 47 | parser.add_argument('--birthday', default='01-01-1990') 48 | parser.add_argument('--credentials-file', default='new_creds.yaml') 49 | args = parser.parse_args() 50 | if args.password is None: 51 | args.password = input('Password: ') 52 | 53 | device_id = random_device_id() 54 | android_id = random_android_id() 55 | logging.basicConfig(format=KikClient.log_format(), level=logging.DEBUG) 56 | client = KikClient(callback=RegisterClient(), 57 | kik_username=args.username, kik_password=args.password, 58 | device_id=device_id, android_id=android_id) 59 | client.register(args.email, args.username, args.password, 60 | args.firstname, args.lastname, args.birthday) 61 | 62 | file_obj = { 63 | 'device_id': device_id, 64 | 'android_id': android_id, 65 | 'username': args.username, 66 | 'password': args.password, 67 | 'node': client.kik_node, 68 | } 69 | with open(args.credentials_file, 'w') as f: 70 | yaml.dump(file_obj, f) 71 | 72 | client.wait_for_messages() 73 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messaging/v2/model_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messaging/v2/model.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 15 | import protobuf_validation_pb2 as protobuf__validation__pb2 16 | import kik_unofficial.protobuf.common.v2_pb2 as model 17 | import kik_unofficial.protobuf.chats.v2_pb2 as chats_common 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messaging.v2.model_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\030com.kik.gen.messaging.v2ZRgithub.com/kikinteractive/xiphias-model-common/generated/go/messaging/v2;messaging\242\002\024KPBCommonMessagingV2' 25 | _MESSAGE.fields_by_name['chat_id']._options = None 26 | _MESSAGE.fields_by_name['chat_id']._serialized_options = b'\312\235%\002\010\001' 27 | _MESSAGE.fields_by_name['sender']._options = None 28 | _MESSAGE.fields_by_name['sender']._serialized_options = b'\312\235%\002\010\001' 29 | _MESSAGE.fields_by_name['client_sent']._options = None 30 | _MESSAGE.fields_by_name['client_sent']._serialized_options = b'\312\235%\002\010\001' 31 | _CHATUPDATE_TEXTPREVIEW.fields_by_name['preview_text']._options = None 32 | _CHATUPDATE_TEXTPREVIEW.fields_by_name['preview_text']._serialized_options = b'\312\235%\005\010\0010\200\010' 33 | _CHATUPDATE.fields_by_name['chat_id']._options = None 34 | _CHATUPDATE.fields_by_name['chat_id']._serialized_options = b'\312\235%\002\010\001' 35 | _CHAT._serialized_start=188 36 | _CHAT._serialized_end=449 37 | _MESSAGE._serialized_start=452 38 | _MESSAGE._serialized_end=692 39 | _MESSAGE_ID._serialized_start=669 40 | _MESSAGE_ID._serialized_end=692 41 | _POINTER._serialized_start=695 42 | _POINTER._serialized_end=926 43 | _POINTER_TYPE._serialized_start=883 44 | _POINTER_TYPE._serialized_end=926 45 | _CHATUPDATE._serialized_start=929 46 | _CHATUPDATE._serialized_end=1566 47 | _CHATUPDATE_TEXTPREVIEW._serialized_start=1351 48 | _CHATUPDATE_TEXTPREVIEW._serialized_end=1397 49 | _CHATUPDATE_IMAGEPREVIEW._serialized_start=1399 50 | _CHATUPDATE_IMAGEPREVIEW._serialized_end=1413 51 | _CHATUPDATE_NAMEUPDATE._serialized_start=1415 52 | _CHATUPDATE_NAMEUPDATE._serialized_end=1441 53 | _CHATUPDATE_PROFILEPICUPDATE._serialized_start=1443 54 | _CHATUPDATE_PROFILEPICUPDATE._serialized_end=1486 55 | _CHATUPDATE_PARTICIPANTSUPDATE._serialized_start=1488 56 | _CHATUPDATE_PARTICIPANTSUPDATE._serialized_end=1555 57 | # @@protoc_insertion_point(module_scope) 58 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/persona/v2/persona_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.persona.v2; 4 | 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/persona/v2;persona"; 6 | option java_package = "com.kik.gen.persona.v2"; 7 | option objc_class_prefix = "KPBMobilePersonaV2"; 8 | 9 | import "protobuf_validation.proto"; 10 | 11 | import "common/v2/model.proto"; 12 | 13 | service Persona { 14 | // Change the first and/or last name for the specified Persona. 15 | // Last name is not required and if it is not specified then any value currently stored for it will be cleared. 16 | // The specified Persona must be owned by the caller of this method; clients cannot change Personas that they 17 | // do not own. 18 | // The specified PersonaId cannot be a wrapper for an AliasJid; the only way to change the display info for an 19 | // AliasJid is to change the info for the Genesis Persona directly that the AliasJid maps to. 20 | rpc SetDisplayName(SetDisplayNameRequest) returns (SetDisplayNameResponse) {} 21 | } 22 | 23 | message SetDisplayNameRequest { 24 | common.v2.PersonaId persona_id = 1 [(kik.validation.field_validation) = { 25 | mandatory: true 26 | }]; 27 | 28 | oneof display_name { 29 | FirstLastName person_name = 2; 30 | } 31 | 32 | // Currently the only name format supported is first and optional last, but we may support 33 | // other name formats in the future 34 | message FirstLastName { 35 | // These first_name, last_name specifications match v1/user_info_shared.proto 36 | // If any first name or last name is allowed that would be rejected by that 37 | // protobuf then calls to UserInfo will fail. 38 | string first_name = 1 [(kik.validation.field_validation) = { 39 | mandatory: true 40 | max_codepoints: 255 41 | }]; 42 | 43 | string last_name = 2 [(kik.validation.field_validation) = { 44 | // Last name is optional to allow cases where we only 45 | // want a single name. An example use cases is bots. 46 | max_codepoints: 255 47 | }]; 48 | } 49 | } 50 | 51 | message SetDisplayNameResponse { 52 | Result result = 1; 53 | enum Result { 54 | OK = 0; 55 | NOT_FOUND = 1; 56 | // Some Personas cannot be changed even by their owner, e.g. AliasJid Personas cannot be 57 | // modified directly because they just map back to the Genesis Persona. Instead the 58 | // Genesis Persona should be modified directly via its PersonaId. 59 | NOT_MODIFIABLE = 2; 60 | // I don't think we need these codes for now because the only name validation done currently 61 | // is extra length checking in AccountUtils.isNameValid and the byte length restrictions in 62 | // here are already more restrictive. However I could see us doing more validation in the 63 | // future; in fact I'm surprised we don't already check against banned words/phrases or 64 | // reject URLs 65 | FIRST_NAME_INVALID = 3; 66 | LAST_NAME_INVALID = 4; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/groups/v1/group_suggest_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: groups/v1/group_suggest_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%groups/v1/group_suggest_service.proto\x12\x10mobile.groups.v1\x1a\x19protobuf_validation.proto\"%\n#GetSuggestedGroupSearchTermsRequest\"\xc7\x02\n$GetSuggestedGroupSearchTermsResponse\x12M\n\x06result\x18\x01 \x01(\x0e\x32=.mobile.groups.v1.GetSuggestedGroupSearchTermsResponse.Result\x12g\n\x0esuggested_term\x18\x02 \x03(\x0b\x32\x44.mobile.groups.v1.GetSuggestedGroupSearchTermsResponse.SuggestedTermB\t\xca\x9d%\x05\x08\x00\x80\x01\x64\x1a<\n\rSuggestedTerm\x12+\n\x04term\x18\x01 \x01(\tB\x1d\xca\x9d%\x19\x08\x01\x12\x15^[A-Za-z0-9._]{1,32}$\")\n\x06Result\x12\x06\n\x02OK\x10\x00\x12\x17\n\x13RATE_LIMIT_EXCEEDED\x10\x01\x32\xa0\x01\n\x0cGroupSuggest\x12\x8f\x01\n\x1cGetSuggestedGroupSearchTerms\x12\x35.mobile.groups.v1.GetSuggestedGroupSearchTermsRequest\x1a\x36.mobile.groups.v1.GetSuggestedGroupSearchTermsResponse\"\x00\x42\\\n\x0e\x63om.kik.groupsZJgithub.com/kikinteractive/xiphias-api-mobile/generated/go/groups/v1;groupsb\x06proto3') 18 | 19 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 20 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'groups.v1.group_suggest_service_pb2', globals()) 21 | if _descriptor._USE_C_DESCRIPTORS == False: 22 | 23 | DESCRIPTOR._options = None 24 | DESCRIPTOR._serialized_options = b'\n\016com.kik.groupsZJgithub.com/kikinteractive/xiphias-api-mobile/generated/go/groups/v1;groups' 25 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE_SUGGESTEDTERM.fields_by_name['term']._options = None 26 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE_SUGGESTEDTERM.fields_by_name['term']._serialized_options = b'\312\235%\031\010\001\022\025^[A-Za-z0-9._]{1,32}$' 27 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE.fields_by_name['suggested_term']._options = None 28 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE.fields_by_name['suggested_term']._serialized_options = b'\312\235%\005\010\000\200\001d' 29 | _GETSUGGESTEDGROUPSEARCHTERMSREQUEST._serialized_start=86 30 | _GETSUGGESTEDGROUPSEARCHTERMSREQUEST._serialized_end=123 31 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE._serialized_start=126 32 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE._serialized_end=453 33 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE_SUGGESTEDTERM._serialized_start=350 34 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE_SUGGESTEDTERM._serialized_end=410 35 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE_RESULT._serialized_start=412 36 | _GETSUGGESTEDGROUPSEARCHTERMSRESPONSE_RESULT._serialized_end=453 37 | _GROUPSUGGEST._serialized_start=456 38 | _GROUPSUGGEST._serialized_end=616 39 | # @@protoc_insertion_point(module_scope) 40 | -------------------------------------------------------------------------------- /examples/send_acks.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | A bot that sends acknowledgements for every message in the account's past messaging history 4 | """ 5 | 6 | import argparse 7 | import logging 8 | import sys 9 | import yaml 10 | 11 | import kik_unofficial.datatypes.xmpp.chatting as chatting 12 | from kik_unofficial.client import KikClient 13 | from kik_unofficial.callbacks import KikClientCallback 14 | from kik_unofficial.datatypes.xmpp.errors import LoginError 15 | from kik_unofficial.datatypes.xmpp.login import LoginResponse, ConnectionFailedResponse 16 | from kik_unofficial.datatypes.xmpp.history import HistoryResponse 17 | 18 | username = sys.argv[1] if len(sys.argv) > 1 else input("Username: ") 19 | password = sys.argv[2] if len(sys.argv) > 2 else input("Password: ") 20 | 21 | 22 | def main(): 23 | parser = argparse.ArgumentParser() 24 | parser.add_argument("-c", "--credentials", default="creds.yaml", help="Credentials file containing at least username, device_id and android_id.") 25 | args = parser.parse_args() 26 | 27 | with open(args.credentials) as f: 28 | creds = yaml.safe_load(f) 29 | if not creds.get("password"): 30 | creds["password"] = input("Password: ") 31 | 32 | # set up logging 33 | logger = logging.getLogger() 34 | logger.setLevel(logging.INFO) 35 | stream_handler = logging.StreamHandler(sys.stdout) 36 | stream_handler.setFormatter(logging.Formatter(KikClient.log_format())) 37 | logger.addHandler(stream_handler) 38 | 39 | # create the bot 40 | bot = AckBot(creds) 41 | bot.wait_for_messages() 42 | 43 | 44 | class AckBot(KikClientCallback): 45 | def __init__(self, creds): 46 | # fmt: off 47 | self.client = KikClient(self, creds["username"], creds["password"], kik_node=creds.get("node"), device_id=creds["device_id"], android_id=creds["android_id"]) # noqa E501 fmt: on 48 | 49 | def on_authenticated(self): 50 | print("Authenticated, requesting messaging history") 51 | self.client.request_messaging_history() 52 | 53 | def on_login_ended(self, response: LoginResponse): 54 | self.client.log.info(f"Full name: {response.first_name} {response.last_name}") 55 | 56 | def on_message_history_response(self, response: HistoryResponse): 57 | self.client.send_ack(messages=response.messages, request_history=response.more) 58 | 59 | def on_chat_message_received(self, chat_message: chatting.IncomingChatMessage): 60 | self.client.log.info(f"'{chat_message.from_jid}' says: {chat_message.body}") 61 | self.client.send_ack(chat_message) 62 | 63 | def on_group_message_received(self, chat_message: chatting.IncomingGroupChatMessage): 64 | self.client.log.info(f"'{chat_message.from_jid}' from group ID {chat_message.group_jid} says: {chat_message.body}") 65 | self.client.send_ack(chat_message) 66 | 67 | # Error handling 68 | def on_connection_failed(self, response: ConnectionFailedResponse): 69 | self.client.log.error(f"Connection failed: {response.message}") 70 | 71 | def on_login_error(self, login_error: LoginError): 72 | if login_error.is_captcha(): 73 | login_error.solve_captcha_wizard(self.client) 74 | 75 | 76 | if __name__ == "__main__": 77 | main() 78 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/chats/v2/chat_info_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: chats/v2/chat_info_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | import kik_unofficial.protobuf.common.v2_pb2 as model 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n chats/v2/chat_info_service.proto\x12\x0fmobile.chats.v2\x1a\x19protobuf_validation.proto\x1a\x15\x63ommon/v2/model.proto\x1a\x18messaging/v2/model.proto\"M\n\x18GetChatInfoStreamRequest\x12\x31\n\x08\x63hat_ids\x18\x01 \x03(\x0b\x32\x11.common.v2.ChatIdB\x0c\xca\x9d%\x08\x08\x01x\x01\x80\x01\x80\x08\"\x9d\x03\n\x19GetChatInfoStreamResponse\x12\x41\n\x06result\x18\x01 \x01(\x0e\x32\x31.mobile.chats.v2.GetChatInfoStreamResponse.Result\x12(\n\x05\x63hats\x18\x02 \x03(\x0b\x32\x19.common.messaging.v2.Chat\x12R\n\x0f\x66\x61ilure_details\x18\x03 \x03(\x0b\x32\x39.mobile.chats.v2.GetChatInfoStreamResponse.FailureDetails\x1a\xac\x01\n\x0e\x46\x61ilureDetails\x12\"\n\x07\x63hat_id\x18\x01 \x01(\x0b\x32\x11.common.v2.ChatId\x12P\n\x06reason\x18\x02 \x01(\x0e\x32@.mobile.chats.v2.GetChatInfoStreamResponse.FailureDetails.Reason\"$\n\x06Reason\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tNOT_FOUND\x10\x01\"\x10\n\x06Result\x12\x06\n\x02OK\x10\x00\x32z\n\x08\x43hatInfo\x12n\n\x11GetChatInfoStream\x12).mobile.chats.v2.GetChatInfoStreamRequest\x1a*.mobile.chats.v2.GetChatInfoStreamResponse\"\x00\x30\x01\x42s\n\x14\x63om.kik.gen.chats.v2ZHgithub.com/kikinteractive/xiphias-api-mobile/generated/go/chats/v2;chats\xa2\x02\x10KPBMobileChatsV2b\x06proto3') 19 | 20 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 21 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'chats.v2.chat_info_service_pb2', globals()) 22 | if _descriptor._USE_C_DESCRIPTORS == False: 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\024com.kik.gen.chats.v2ZHgithub.com/kikinteractive/xiphias-api-mobile/generated/go/chats/v2;chats\242\002\020KPBMobileChatsV2' 26 | _GETCHATINFOSTREAMREQUEST.fields_by_name['chat_ids']._options = None 27 | _GETCHATINFOSTREAMREQUEST.fields_by_name['chat_ids']._serialized_options = b'\312\235%\010\010\001x\001\200\001\200\010' 28 | _GETCHATINFOSTREAMREQUEST._serialized_start=129 29 | _GETCHATINFOSTREAMREQUEST._serialized_end=206 30 | _GETCHATINFOSTREAMRESPONSE._serialized_start=209 31 | _GETCHATINFOSTREAMRESPONSE._serialized_end=622 32 | _GETCHATINFOSTREAMRESPONSE_FAILUREDETAILS._serialized_start=432 33 | _GETCHATINFOSTREAMRESPONSE_FAILUREDETAILS._serialized_end=604 34 | _GETCHATINFOSTREAMRESPONSE_FAILUREDETAILS_REASON._serialized_start=568 35 | _GETCHATINFOSTREAMRESPONSE_FAILUREDETAILS_REASON._serialized_end=604 36 | _GETCHATINFOSTREAMRESPONSE_RESULT._serialized_start=606 37 | _GETCHATINFOSTREAMRESPONSE_RESULT._serialized_end=622 38 | _CHATINFO._serialized_start=624 39 | _CHATINFO._serialized_end=746 40 | # @@protoc_insertion_point(module_scope) 41 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/iam/v2/authentication_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mobile.iam.v2; 4 | 5 | option go_package = "github.com/kikinteractive/xiphias-api-mobile/generated/go/iam/v2;iam"; 6 | option java_package = "com.kik.gen.iam.v2"; 7 | option objc_class_prefix = "KPBMobileIAMV2"; 8 | 9 | import "protobuf_validation.proto"; 10 | import "common/v2/model.proto"; 11 | import "session/v2/model.proto"; 12 | 13 | // Authentication is the 'public' facing service that clients use to authenticate 14 | // a user and provide session tokens. 15 | service Authentication { 16 | // Authenticate authenticates the user using an ID and secret pair. A session 17 | // token is provided on success that authorizes a user to perform authenticated 18 | // requests, which should be provided as a header. Clients wishing to get new 19 | // sessions MUST go through this API call. 20 | rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse) {} 21 | 22 | // Logout terminates the user's session by invalidating their session token. 23 | // This request must be authenticated using the user's current session token. 24 | rpc Logout(LogoutRequest) returns (LogoutResponse) {} 25 | } 26 | 27 | message AuthenticateRequest { 28 | oneof credentials { 29 | UsernameCredentials username_credentials = 1; 30 | EmailCredentials email_credentials = 2; 31 | } 32 | 33 | common.v2.ClientInstanceId client_instance_id = 10 [(kik.validation.field_validation) = { 34 | mandatory: true 35 | }]; 36 | 37 | // The set of credentials when a user logs in using their username 38 | message UsernameCredentials{ 39 | common.v2.Username username = 1 [(kik.validation.field_validation) = { 40 | mandatory: true 41 | }]; 42 | 43 | // The username-derived passkey as described in https://github.com/kikinteractive/kik-product/wiki/Passkeys 44 | bytes passkey = 2 [(kik.validation.field_validation) = { 45 | mandatory: true 46 | max_byte_length: 1024 47 | }]; 48 | } 49 | 50 | // The set of credentials when a user logs in user their email address 51 | message EmailCredentials { 52 | common.v2.Email email = 1 [(kik.validation.field_validation) = { 53 | mandatory: true 54 | }]; 55 | 56 | // The email-derived passkey as described in https://github.com/kikinteractive/kik-product/wiki/Passkeys 57 | bytes passkey = 2 [(kik.validation.field_validation) = { 58 | mandatory: true 59 | max_byte_length: 1024 60 | }]; 61 | } 62 | } 63 | 64 | message AuthenticateResponse { 65 | Result result = 1; 66 | enum Result { 67 | OK = 0; 68 | FAILED = 1; 69 | } 70 | 71 | // Clients should use this session token in a header to authenticate subsequent 72 | // requests 73 | // 74 | // Set iff Result == OK 75 | common.session.v2.SessionToken session_token = 2; 76 | 77 | // Set iff Result == OK 78 | common.v2.AccountId account_id = 3; 79 | 80 | // TODO: THIS IS NOT MEANT FOR RELEASE 81 | // JUST FOR MILESTONE ONE 82 | common.v2.PersonaId genesis_persona = 4; 83 | } 84 | 85 | message LogoutRequest { 86 | } 87 | 88 | message LogoutResponse { 89 | Result result = 1; 90 | enum Result { 91 | OK = 0; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/bridgetest/v1/bridgetest_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: bridgetest/v1/bridgetest_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 15 | from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 16 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 17 | import kik_unofficial.protobuf.common_rpc_pb2 as common__rpc__pb2 18 | import kik_unofficial.protobuf.kik_options_pb2 as kik__options__pb2 19 | 20 | 21 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%bridgetest/v1/bridgetest_common.proto\x12\x14\x63ommon.bridgetest.v1\x1a\x19protobuf_validation.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x12\x63ommon_model.proto\x1a\x10\x63ommon_rpc.proto\x1a\x11kik_options.proto\"(\n\x0b\x45\x63hoRequest\x12\x19\n\x07message\x18\x01 \x01(\tB\x08\xca\x9d%\x04\x30\xa0\x8d\x06\")\n\x0c\x45\x63hoResponse\x12\x19\n\x07message\x18\x01 \x01(\tB\x08\xca\x9d%\x04\x30\xa0\x8d\x06\"E\n\x0eWorkoutRequest\x12\x33\n\x08\x64uration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x06\xca\x9d%\x02\x08\x01\"\x9d\x01\n\x16ValidateHeadersRequest\x12\x0f\n\x07is_auth\x18\x01 \x01(\x08\x12\"\n\x03jid\x18\x02 \x01(\x0b\x32\x15.common.XiBareUserJid\x12%\n\tdevice_id\x18\x03 \x01(\x0b\x32\x12.common.XiDeviceId\x12\'\n\nrequest_id\x18\x04 \x01(\x0b\x32\x13.common.XiRequestId\"+\n\x17ValidateHeadersResponse\x12\x10\n\x08is_valid\x18\x01 \x01(\x08\x42n\n\x12\x63om.kik.bridgetestZRgithub.com/kikinteractive/xiphias-api-mobile/generated/go/bridgetest/v1;bridgetest\xaa\xa3*\x02\x18\x01\x62\x06proto3') 22 | 23 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 24 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'bridgetest.v1.bridgetest_common_pb2', globals()) 25 | if _descriptor._USE_C_DESCRIPTORS == False: 26 | 27 | DESCRIPTOR._options = None 28 | DESCRIPTOR._serialized_options = b'\n\022com.kik.bridgetestZRgithub.com/kikinteractive/xiphias-api-mobile/generated/go/bridgetest/v1;bridgetest\252\243*\002\030\001' 29 | _ECHOREQUEST.fields_by_name['message']._options = None 30 | _ECHOREQUEST.fields_by_name['message']._serialized_options = b'\312\235%\0040\240\215\006' 31 | _ECHORESPONSE.fields_by_name['message']._options = None 32 | _ECHORESPONSE.fields_by_name['message']._serialized_options = b'\312\235%\0040\240\215\006' 33 | _WORKOUTREQUEST.fields_by_name['duration']._options = None 34 | _WORKOUTREQUEST.fields_by_name['duration']._serialized_options = b'\312\235%\002\010\001' 35 | _ECHOREQUEST._serialized_start=179 36 | _ECHOREQUEST._serialized_end=219 37 | _ECHORESPONSE._serialized_start=221 38 | _ECHORESPONSE._serialized_end=262 39 | _WORKOUTREQUEST._serialized_start=264 40 | _WORKOUTREQUEST._serialized_end=333 41 | _VALIDATEHEADERSREQUEST._serialized_start=336 42 | _VALIDATEHEADERSREQUEST._serialized_end=493 43 | _VALIDATEHEADERSRESPONSE._serialized_start=495 44 | _VALIDATEHEADERSRESPONSE._serialized_end=538 45 | # @@protoc_insertion_point(module_scope) 46 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/antispam/safetynet/v1/safetynet_service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: antispam/safetynet/v1/safetynet_service.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_rpc_pb2 as common__rpc__pb2 15 | import kik_unofficial.protobuf.protobuf_validation_pb2 as protobuf__validation__pb2 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-antispam/safetynet/v1/safetynet_service.proto\x12\x1cmobile.antispam.safetynet.v1\x1a\x10\x63ommon_rpc.proto\x1a\x19protobuf_validation.proto\"\x84\x01\n\x10GetNonceResponse\x12\x45\n\x06result\x18\x01 \x01(\x0e\x32\x35.mobile.antispam.safetynet.v1.GetNonceResponse.Result\x12\x17\n\x05nonce\x18\x02 \x01(\tB\x08\xca\x9d%\x04\x08\x01(\x10\"\x10\n\x06Result\x12\x06\n\x02OK\x10\x00\";\n\x1eVerifyAttestationResultRequest\x12\x19\n\x03jws\x18\x01 \x01(\tB\x0c\xca\x9d%\x08\x08\x01(\x01\x30\xa8\xc3\x01\"\xb3\x01\n\x1fVerifyAttestationResultResponse\x12T\n\x06result\x18\x01 \x01(\x0e\x32\x44.mobile.antispam.safetynet.v1.VerifyAttestationResultResponse.Result\":\n\x06Result\x12\x06\n\x02OK\x10\x00\x12\x11\n\rINVALID_NONCE\x10\x01\x12\x15\n\x11MALFORMED_REQUEST\x10\x02\x32\xf9\x01\n\tSafetyNet\x12Q\n\x08GetNonce\x12\x13.common.VoidRequest\x1a..mobile.antispam.safetynet.v1.GetNonceResponse\"\x00\x12\x98\x01\n\x17VerifyAttestationResult\x12<.mobile.antispam.safetynet.v1.VerifyAttestationResultRequest\x1a=.mobile.antispam.safetynet.v1.VerifyAttestationResultResponse\"\x00\x42{\n\x1e\x63om.kik.antispam.safetynet.rpcZYgithub.com/kikinteractive/xiphias-api-mobile/generated/go/antispam/safetynet/v1;safetynetb\x06proto3') 19 | 20 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 21 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'antispam.safetynet.v1.safetynet_service_pb2', globals()) 22 | if _descriptor._USE_C_DESCRIPTORS == False: 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\036com.kik.antispam.safetynet.rpcZYgithub.com/kikinteractive/xiphias-api-mobile/generated/go/antispam/safetynet/v1;safetynet' 26 | _GETNONCERESPONSE.fields_by_name['nonce']._options = None 27 | _GETNONCERESPONSE.fields_by_name['nonce']._serialized_options = b'\312\235%\004\010\001(\020' 28 | _VERIFYATTESTATIONRESULTREQUEST.fields_by_name['jws']._options = None 29 | _VERIFYATTESTATIONRESULTREQUEST.fields_by_name['jws']._serialized_options = b'\312\235%\010\010\001(\0010\250\303\001' 30 | _GETNONCERESPONSE._serialized_start=125 31 | _GETNONCERESPONSE._serialized_end=257 32 | _GETNONCERESPONSE_RESULT._serialized_start=241 33 | _GETNONCERESPONSE_RESULT._serialized_end=257 34 | _VERIFYATTESTATIONRESULTREQUEST._serialized_start=259 35 | _VERIFYATTESTATIONRESULTREQUEST._serialized_end=318 36 | _VERIFYATTESTATIONRESULTRESPONSE._serialized_start=321 37 | _VERIFYATTESTATIONRESULTRESPONSE._serialized_end=500 38 | _VERIFYATTESTATIONRESULTRESPONSE_RESULT._serialized_start=442 39 | _VERIFYATTESTATIONRESULTRESPONSE_RESULT._serialized_end=500 40 | _SAFETYNET._serialized_start=503 41 | _SAFETYNET._serialized_end=752 42 | # @@protoc_insertion_point(module_scope) 43 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/messagepath/v1/core_message_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: messagepath/v1/core_message_common.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import builder as _builder 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import kik_unofficial.protobuf.common_model_pb2 as common__model__pb2 15 | import protobuf_validation_pb2 as protobuf__validation__pb2 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(messagepath/v1/core_message_common.proto\x12\x15\x63ommon.messagepath.v1\x1a\x12\x63ommon_model.proto\x1a\x19protobuf_validation.proto\"c\n\x15\x41ttributionAttachment\x12\x15\n\x04name\x18\x01 \x01(\tB\x07\xca\x9d%\x03\x30\xf4\x03\x12\x33\n\x04icon\x18\x02 \x01(\x0b\x32%.common.messagepath.v1.PictureElement\"\xa8\x01\n\x14\x43ontentLayoutElement\x12K\n\x04type\x18\x01 \x01(\x0e\x32=.common.messagepath.v1.ContentLayoutElement.ContentLayoutType\"C\n\x11\x43ontentLayoutType\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x0b\n\x07\x41RTICLE\x10\x01\x12\t\n\x05PHOTO\x10\x02\x12\t\n\x05VIDEO\x10\x03\"&\n\x0ePictureElement\x12\x14\n\x03url\x18\x01 \x01(\tB\x07\xca\x9d%\x03\x30\x80(\"\xb5\x01\n\nUriElement\x12\x16\n\x03uri\x18\x01 \x01(\tB\t\xca\x9d%\x05\x08\x01\x30\x80(\x12<\n\x08platform\x18\x64 \x01(\x0e\x32*.common.messagepath.v1.UriElement.Platform\x12\x11\n\x08priority\x18\xe8\x07 \x01(\r\">\n\x08Platform\x12\x07\n\x03\x41LL\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x07\n\x03IOS\x10\x02\x12\x0b\n\x07\x41NDROID\x10\x03\x12\n\n\x06WIDGET\x10\x04\x42z\n\x19\x63om.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\xa2\x02\x04MPTHb\x06proto3') 19 | 20 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) 21 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messagepath.v1.core_message_common_pb2', globals()) 22 | if _descriptor._USE_C_DESCRIPTORS == False: 23 | 24 | DESCRIPTOR._options = None 25 | DESCRIPTOR._serialized_options = b'\n\031com.kik.messagepath.modelZVgithub.com/kikinteractive/xiphias-model-common/generated/go/messagepath/v1;messagepath\242\002\004MPTH' 26 | _ATTRIBUTIONATTACHMENT.fields_by_name['name']._options = None 27 | _ATTRIBUTIONATTACHMENT.fields_by_name['name']._serialized_options = b'\312\235%\0030\364\003' 28 | _PICTUREELEMENT.fields_by_name['url']._options = None 29 | _PICTUREELEMENT.fields_by_name['url']._serialized_options = b'\312\235%\0030\200(' 30 | _URIELEMENT.fields_by_name['uri']._options = None 31 | _URIELEMENT.fields_by_name['uri']._serialized_options = b'\312\235%\005\010\0010\200(' 32 | _ATTRIBUTIONATTACHMENT._serialized_start=114 33 | _ATTRIBUTIONATTACHMENT._serialized_end=213 34 | _CONTENTLAYOUTELEMENT._serialized_start=216 35 | _CONTENTLAYOUTELEMENT._serialized_end=384 36 | _CONTENTLAYOUTELEMENT_CONTENTLAYOUTTYPE._serialized_start=317 37 | _CONTENTLAYOUTELEMENT_CONTENTLAYOUTTYPE._serialized_end=384 38 | _PICTUREELEMENT._serialized_start=386 39 | _PICTUREELEMENT._serialized_end=424 40 | _URIELEMENT._serialized_start=427 41 | _URIELEMENT._serialized_end=608 42 | _URIELEMENT_PLATFORM._serialized_start=546 43 | _URIELEMENT_PLATFORM._serialized_end=608 44 | # @@protoc_insertion_point(module_scope) 45 | -------------------------------------------------------------------------------- /kik_unofficial/protobuf/protobuf_source/common/v2/model.proto: -------------------------------------------------------------------------------- 1 | // EXPERIMENTAL: The definitions here are experimental and subject to change at 2 | // any moment. They are pulled in from the kikx branch, which should be used as 3 | // the source of truth for any Kikx work. These appear in master to unblock work 4 | // on legacy systems. 5 | 6 | syntax = "proto3"; 7 | 8 | package common.v2; 9 | option java_package = "com.kik.gen.common.v2"; 10 | option java_multiple_files = true; 11 | option java_generate_equals_and_hash = true; 12 | option objc_class_prefix = "KPBCommonV2"; 13 | option (.kik.checkstyle) = { 14 | ignore_path: true 15 | }; 16 | 17 | option go_package = "github.com/kikinteractive/xiphias-model-common/generated/go/common/v2;common"; 18 | 19 | import "kik_options.proto"; 20 | import "protobuf_validation.proto"; 21 | 22 | message AccountId { 23 | // In the future; we may move away from this legacy field. At that point, 24 | // we would migrate to using oneof 25 | string local_part = 1 [(kik.validation.field_validation) = { 26 | mandatory: true 27 | regex: "^[a-z_0-9\\.]{2,30}(_[a-z0-9]{3})?$" 28 | }]; 29 | } 30 | 31 | message PersonaId { 32 | bytes raw_value = 1 [(kik.validation.field_validation) = { 33 | mandatory: true 34 | max_byte_length: 128 35 | }]; 36 | } 37 | 38 | message ChatId { 39 | // The raw_value contains a serialized protobuf message that describes 40 | // the underlying details of the ChatId. The following restrictions 41 | // are applied: 42 | // 43 | // 1. ChatId's are immutable. 44 | // 2. Clients must never attempt to deserialize the raw_value. 45 | // 3. Clients _may_ set raw_value to be a serialized mobile.chats.v2.MobileChatId, 46 | // but _only_ when creating a ChatId (see (1)). 47 | // 3. mobile.chats.v2.MobileChatId _must_ be a wire compatible subset of internal.chats.v2.InternalChatId. 48 | // 49 | bytes raw_value = 1 [(kik.validation.field_validation) = { 50 | mandatory: true 51 | min_byte_length: 1 52 | max_byte_length: 512 53 | }]; 54 | } 55 | 56 | // OneToOneId should contain the two participants of a one to one chat 57 | // that are sorted in a deterministic way. 58 | message OneToOneId { 59 | repeated PersonaId personas = 1 [(kik.validation.field_validation) = { 60 | mandatory: true 61 | // ordered: ASC todo: requires byte comparable support in Java 62 | min_repetitions: 2 63 | max_repetitions: 2 64 | }]; 65 | } 66 | 67 | message ClientInstanceId { 68 | bytes raw_value = 1 [(kik.validation.field_validation) = { 69 | mandatory: true 70 | max_byte_length: 100 71 | }]; 72 | } 73 | 74 | message Uuid { 75 | bytes raw_value = 1 [(kik.validation.field_validation) = { 76 | mandatory: true 77 | min_byte_length: 16 78 | max_byte_length: 16 79 | }]; 80 | } 81 | 82 | message Email { 83 | string email = 1 [(kik.validation.field_validation) = { 84 | mandatory: true 85 | max_byte_length: 1016 86 | regex: "^[\\w\\-+]+(\\.[\\w\\-+]+)*@[A-Za-z0-9][A-Za-z0-9\\-]*(\\.[A-Za-z0-9][A-Za-z0-9\\-]*)*(\\.[A-Za-z]{2,})$" 87 | }]; 88 | } 89 | 90 | // Used for account registration purposes, and as the internal basis for the user's Genesis PersonaId 91 | message Username { 92 | // username to check uniqueness of. 93 | string username = 2 [(kik.validation.field_validation) = { 94 | mandatory: true 95 | regex: "^[\\w\\.]{2,30}$" 96 | }]; 97 | } 98 | --------------------------------------------------------------------------------