├── lib ├── poke-api │ ├── version.rb │ ├── geometry │ │ ├── s2_lat_lon.rb │ │ ├── s2_point.rb │ │ ├── s2_base.rb │ │ └── s2_cell_id.rb │ ├── pogoprotos │ │ ├── setup_protobufs.rb │ │ ├── pogoprotos_data_gym.rb │ │ ├── pogoprotos_data_capture.rb │ │ ├── pogoprotos_map.rb │ │ ├── pogoprotos_map_pokemon.rb │ │ ├── pogoprotos_settings_master_pokemon.rb │ │ ├── pogoprotos_data_logs.rb │ │ ├── pogoprotos_inventory_item.rb │ │ ├── pogoprotos_map_fort.rb │ │ ├── pogoprotos_settings.rb │ │ ├── pogoprotos_networking_requests.rb │ │ ├── pogoprotos_data_player.rb │ │ ├── pogoprotos_settings_master_item.rb │ │ ├── pogoprotos_data.rb │ │ ├── pogoprotos_data_battle.rb │ │ ├── pogoprotos_inventory.rb │ │ ├── pogoprotos_networking_envelopes.rb │ │ ├── pogoprotos_settings_master.rb │ │ ├── pogoprotos_networking_requests_messages.rb │ │ ├── pogoprotos_enums.rb │ │ └── pogoprotos_networking_responses.rb │ ├── logging.rb │ ├── auth │ │ ├── ticket.rb │ │ ├── ptc.rb │ │ └── google.rb │ ├── helpers.rb │ ├── errors.rb │ ├── signature.rb │ ├── response.rb │ ├── client.rb │ └── request_builder.rb └── poke-api.rb ├── Rakefile ├── .codeclimate.yml ├── poke-api.gemspec ├── LICENSE.txt ├── example.rb ├── examples └── spiral_search.rb ├── CHANGELOG.md └── README.md /lib/poke-api/version.rb: -------------------------------------------------------------------------------- 1 | module Poke 2 | module API 3 | VERSION = '0.2.1'.freeze 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'bundler/gem_tasks' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) 5 | 6 | task default: :spec 7 | -------------------------------------------------------------------------------- /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | engines: 3 | radon: 4 | enabled: true 5 | rubocop: 6 | enabled: true 7 | ratings: 8 | paths: 9 | - "**.inc" 10 | - "**.js" 11 | - "**.jsx" 12 | - "**.module" 13 | - "**.php" 14 | - "**.py" 15 | - "**.rb" 16 | exclude_paths: [''] 17 | -------------------------------------------------------------------------------- /lib/poke-api/geometry/s2_lat_lon.rb: -------------------------------------------------------------------------------- 1 | module Poke 2 | module API 3 | module Geometry 4 | class S2LatLon 5 | def initialize(lat_degrees, lon_degrees) 6 | @lat = lat_degrees * Math::PI / 180 7 | @lon = lon_degrees * Math::PI / 180 8 | end 9 | 10 | def to_point 11 | phi = @lat 12 | theta = @lon 13 | cosphi = Math.cos(phi) 14 | S2Point.new(Math.cos(theta) * cosphi, Math.sin(theta) * cosphi, Math.sin(phi)) 15 | end 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/setup_protobufs.rb: -------------------------------------------------------------------------------- 1 | # Only to generate proper ruby file name convention 2 | 3 | files = Dir.glob('*') 4 | 5 | def replace_name(input) 6 | input.gsub(/\.(?=[^.]*\.)/, '_').downcase 7 | end 8 | 9 | files.each do |file| 10 | fopen = File.open(file) 11 | 12 | new_body = fopen.each_line.map do |x| 13 | if x =~ /require_relative 'pog/i 14 | x = x.sub('require', 'require_relative').downcase.tr('.', '_') 15 | end 16 | x 17 | end.join 18 | 19 | File.open(file, 'w') {|f| f.puts new_body } 20 | end 21 | 22 | files.each {|f| File.rename(f, replace_name(f))} 23 | -------------------------------------------------------------------------------- /lib/poke-api/geometry/s2_point.rb: -------------------------------------------------------------------------------- 1 | module Poke 2 | module API 3 | module Geometry 4 | class S2Point 5 | attr_reader :x, :y, :z 6 | 7 | def initialize(x, y, z) 8 | @x = x 9 | @y = y 10 | @z = z 11 | end 12 | 13 | def abs 14 | [@x.abs, @y.abs, @z.abs] 15 | end 16 | 17 | def largest_abs_component 18 | temp = abs 19 | 20 | if temp[0] > temp[1] 21 | temp[0] > temp[2] ? 0 : 2 22 | else 23 | temp[1] > temp[2] ? 1 : 2 24 | end 25 | end 26 | 27 | def dot_prod(o) 28 | @x * o.x + @y * o.y + @z * o.z 29 | end 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/poke-api.rb: -------------------------------------------------------------------------------- 1 | # Load main Poke::API related classes 2 | require 'poke-api/logging' 3 | require 'poke-api/client' 4 | require 'poke-api/helpers' 5 | require 'poke-api/request_builder' 6 | require 'poke-api/response' 7 | require 'poke-api/errors' 8 | require 'poke-api/version' 9 | require 'poke-api/signature' 10 | require 'poke-api/auth/ptc' 11 | require 'poke-api/auth/google' 12 | require 'poke-api/auth/ticket' 13 | 14 | # Load Geometry libraries (native Ruby) 15 | require 'poke-api/geometry/s2_base' 16 | require 'poke-api/geometry/s2_cell_id' 17 | require 'poke-api/geometry/s2_lat_lon' 18 | require 'poke-api/geometry/s2_point' 19 | 20 | # Load Google Generated POGOProtos 21 | require 'poke-api/pogoprotos/pogoprotos_networking_envelopes' 22 | require 'poke-api/pogoprotos/pogoprotos_networking_requests_messages' 23 | require 'poke-api/pogoprotos/pogoprotos_networking_responses' 24 | -------------------------------------------------------------------------------- /poke-api.gemspec: -------------------------------------------------------------------------------- 1 | lib = File.expand_path('../lib', __FILE__) 2 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 3 | 4 | require_relative 'lib/poke-api/version' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = 'poke-go-api' 8 | spec.summary = 'Poke API' 9 | 10 | spec.description = 'An API wrapper for Pokemon GO' 11 | spec.version = Poke::API::VERSION 12 | 13 | spec.date = '2016-08-21' 14 | spec.authors = ['Nabeel Amjad'] 15 | spec.licenses = ['MIT'] 16 | 17 | spec.files = Dir.glob('lib/**/*') 18 | spec.homepage = 'https://github.com/nabeelamjad/poke-api' 19 | 20 | spec.add_runtime_dependency 'httpclient', '2.8.0' 21 | spec.add_runtime_dependency 'geocoder', '1.3.7' 22 | spec.add_runtime_dependency 'google-protobuf', '~> 3.0.0.alpha' 23 | spec.add_runtime_dependency 'gpsoauth-rb', '0.1.2' 24 | spec.add_runtime_dependency 'ruby-xxHash', '0.4.0.1' 25 | end 26 | -------------------------------------------------------------------------------- /lib/poke-api/logging.rb: -------------------------------------------------------------------------------- 1 | require 'logger' 2 | require 'time' 3 | 4 | module Poke 5 | module API 6 | module Logging 7 | @@loggers = {} 8 | @@log_level = :INFO 9 | @@formatter = proc do |severity, datetime, progname, msg| 10 | sev_color = ['INFO', 'DEBUG', 'ANY'].include?(severity) ? "\e[32m" : "\e[31m" 11 | 12 | "[\e[36m%s\e[0m]: #{sev_color}%-5s\e[0m > \e[33m%-25s\e[0m --: %s\n" \ 13 | % [datetime.iso8601, severity, progname, msg] 14 | end 15 | 16 | def logger 17 | @@loggers[self.class.name] ||= Logger.new(STDOUT).tap do |logger| 18 | logger.progname = self.class.name == 'Module' ? self.name : self.class.name 19 | logger.level = Logger.const_get(@@log_level) 20 | logger.formatter = @@formatter 21 | end 22 | end 23 | 24 | def self.log_level=(level) 25 | @@log_level = level 26 | end 27 | 28 | def self.formatter=(formatter) 29 | @@formatter = formatter 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Nabeel Amjad 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 15 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 18 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 19 | OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_data_gym.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Data.Gym.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_data' 7 | require_relative 'pogoprotos_data_player' 8 | require_relative 'pogoprotos_map_fort' 9 | Google::Protobuf::DescriptorPool.generated_pool.build do 10 | add_message "POGOProtos.Data.Gym.GymMembership" do 11 | optional :pokemon_data, :message, 1, "POGOProtos.Data.PokemonData" 12 | optional :trainer_public_profile, :message, 2, "POGOProtos.Data.Player.PlayerPublicProfile" 13 | end 14 | add_message "POGOProtos.Data.Gym.GymState" do 15 | optional :fort_data, :message, 1, "POGOProtos.Map.Fort.FortData" 16 | repeated :memberships, :message, 2, "POGOProtos.Data.Gym.GymMembership" 17 | end 18 | end 19 | 20 | module POGOProtos 21 | module Data 22 | module Gym 23 | GymMembership = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Gym.GymMembership").msgclass 24 | GymState = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Gym.GymState").msgclass 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_data_capture.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Data.Capture.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_enums' 7 | require_relative 'pogoprotos_inventory_item' 8 | Google::Protobuf::DescriptorPool.generated_pool.build do 9 | add_message "POGOProtos.Data.Capture.CaptureAward" do 10 | repeated :activity_type, :enum, 1, "POGOProtos.Enums.ActivityType" 11 | repeated :xp, :int32, 2 12 | repeated :candy, :int32, 3 13 | repeated :stardust, :int32, 4 14 | end 15 | add_message "POGOProtos.Data.Capture.CaptureProbability" do 16 | repeated :pokeball_type, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 17 | repeated :capture_probability, :float, 2 18 | optional :reticle_difficulty_scale, :double, 12 19 | end 20 | end 21 | 22 | module POGOProtos 23 | module Data 24 | module Capture 25 | CaptureAward = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Capture.CaptureAward").msgclass 26 | CaptureProbability = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Capture.CaptureProbability").msgclass 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /example.rb: -------------------------------------------------------------------------------- 1 | require 'poke-api' 2 | require 'pp' 3 | 4 | # Refer to README for information for setting up a Proxy if required 5 | 6 | # Instantiate the client 7 | client = Poke::API::Client.new 8 | 9 | # Store your location, you can also store your lat/lng directly 10 | # using client.store_lat_lng(lat, lng) 11 | # or using client.lat = 10, client.lng = 10, client.alt = 10 12 | client.store_location('New York') 13 | 14 | # Use Google auth with 'username@gmail.com', 'password', 'google' 15 | # Optionally set your Google Refresh token using client.refresh_token = 'my-token' 16 | client.login('username', 'password', 'ptc') 17 | 18 | # Activate the encryption method to generate a signature 19 | # Where path is the path to your encrypt .so/.dll 20 | client.activate_signature('/path/to/encrypt/file') 21 | 22 | # Get cells 23 | cell_ids = Poke::API::Helpers.get_cells(client.lat, client.lng) 24 | 25 | # Construct map objects call 26 | client.get_map_objects( 27 | latitude: client.lat, 28 | longitude: client.lng, 29 | since_timestamp_ms: [0] * cell_ids.length, 30 | cell_id: cell_ids 31 | ) 32 | 33 | # Add more calls 34 | client.get_player 35 | client.get_inventory 36 | 37 | # Call and view response 38 | resp = client.call 39 | pp resp 40 | -------------------------------------------------------------------------------- /lib/poke-api/auth/ticket.rb: -------------------------------------------------------------------------------- 1 | module Poke 2 | module API 3 | module Auth 4 | class Ticket 5 | include Logging 6 | attr_reader :start, :ends, :expire 7 | 8 | def initialize 9 | @expire = nil 10 | @start = nil 11 | @ends = nil 12 | end 13 | 14 | def has_ticket? 15 | return true if @start && @ends && @expire 16 | false 17 | end 18 | 19 | def set_ticket(auth) 20 | @expire = auth[:expire_timestamp_ms] 21 | @start = auth[:start] 22 | @ends = auth[:end] 23 | end 24 | 25 | def is_new_ticket?(new_ticket_time) 26 | return true unless @expire && new_ticket_time > @expire 27 | false 28 | end 29 | 30 | def get_ticket 31 | return false unless check_ticket 32 | true 33 | end 34 | 35 | private 36 | 37 | def check_ticket 38 | return false unless has_ticket? 39 | now = Helpers.fetch_time 40 | 41 | if now < (@expire - 10000) 42 | duration = format('%02d:%02d:%02d', *Helpers.format_time_diff(now, @expire)) 43 | logger.info "[+] Auth ticket is valid for #{duration}" 44 | return true 45 | end 46 | 47 | @expire, @start, @ends = nil 48 | logger.info '[+] Removed expired auth ticket' 49 | false 50 | end 51 | end 52 | end 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_map.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Map.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_map_fort' 7 | require_relative 'pogoprotos_map_pokemon' 8 | Google::Protobuf::DescriptorPool.generated_pool.build do 9 | add_message "POGOProtos.Map.MapCell" do 10 | optional :s2_cell_id, :uint64, 1 11 | optional :current_timestamp_ms, :int64, 2 12 | repeated :forts, :message, 3, "POGOProtos.Map.Fort.FortData" 13 | repeated :spawn_points, :message, 4, "POGOProtos.Map.SpawnPoint" 14 | repeated :deleted_objects, :string, 6 15 | optional :is_truncated_list, :bool, 7 16 | repeated :fort_summaries, :message, 8, "POGOProtos.Map.Fort.FortSummary" 17 | repeated :decimated_spawn_points, :message, 9, "POGOProtos.Map.SpawnPoint" 18 | repeated :wild_pokemons, :message, 5, "POGOProtos.Map.Pokemon.WildPokemon" 19 | repeated :catchable_pokemons, :message, 10, "POGOProtos.Map.Pokemon.MapPokemon" 20 | repeated :nearby_pokemons, :message, 11, "POGOProtos.Map.Pokemon.NearbyPokemon" 21 | end 22 | add_message "POGOProtos.Map.SpawnPoint" do 23 | optional :latitude, :double, 2 24 | optional :longitude, :double, 3 25 | end 26 | add_enum "POGOProtos.Map.MapObjectsStatus" do 27 | value :UNSET_STATUS, 0 28 | value :SUCCESS, 1 29 | value :LOCATION_UNSET, 2 30 | end 31 | end 32 | 33 | module POGOProtos 34 | module Map 35 | MapCell = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.MapCell").msgclass 36 | SpawnPoint = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.SpawnPoint").msgclass 37 | MapObjectsStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.MapObjectsStatus").enummodule 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_map_pokemon.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Map.Pokemon.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_data' 7 | require_relative 'pogoprotos_enums' 8 | Google::Protobuf::DescriptorPool.generated_pool.build do 9 | add_message "POGOProtos.Map.Pokemon.WildPokemon" do 10 | optional :encounter_id, :fixed64, 1 11 | optional :last_modified_timestamp_ms, :int64, 2 12 | optional :latitude, :double, 3 13 | optional :longitude, :double, 4 14 | optional :spawn_point_id, :string, 5 15 | optional :pokemon_data, :message, 7, "POGOProtos.Data.PokemonData" 16 | optional :time_till_hidden_ms, :int32, 11 17 | end 18 | add_message "POGOProtos.Map.Pokemon.NearbyPokemon" do 19 | optional :pokemon_id, :enum, 1, "POGOProtos.Enums.PokemonId" 20 | optional :distance_in_meters, :float, 2 21 | optional :encounter_id, :fixed64, 3 22 | optional :fort_id, :string, 4 23 | optional :fort_image_url, :string, 5 24 | end 25 | add_message "POGOProtos.Map.Pokemon.MapPokemon" do 26 | optional :spawn_point_id, :string, 1 27 | optional :encounter_id, :fixed64, 2 28 | optional :pokemon_id, :enum, 3, "POGOProtos.Enums.PokemonId" 29 | optional :expiration_timestamp_ms, :int64, 4 30 | optional :latitude, :double, 5 31 | optional :longitude, :double, 6 32 | end 33 | end 34 | 35 | module POGOProtos 36 | module Map 37 | module Pokemon 38 | WildPokemon = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Pokemon.WildPokemon").msgclass 39 | NearbyPokemon = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Pokemon.NearbyPokemon").msgclass 40 | MapPokemon = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Pokemon.MapPokemon").msgclass 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /lib/poke-api/geometry/s2_base.rb: -------------------------------------------------------------------------------- 1 | module Poke 2 | module API 3 | module Geometry 4 | module S2Base 5 | LINEAR_PROJECTION = 0 6 | TAN_PROJECTION = 1 7 | QUADRATIC_PROJECTION = 2 8 | 9 | MAX_LEVEL = 30 10 | NUM_FACES = 6 11 | POS_BITS = 2 * MAX_LEVEL + 1 12 | MAX_SIZE = 1 << MAX_LEVEL 13 | SWAP_MASK = 0x01 14 | INVERT_MASK = 0x02 15 | LOOKUP_BITS = 4 16 | POS_TO_OR = [SWAP_MASK, 0, 0, INVERT_MASK | SWAP_MASK].freeze 17 | POS_TO_IJ = [[0, 1, 3, 2], 18 | [0, 2, 3, 1], 19 | [3, 2, 0, 1], 20 | [3, 1, 0, 2]].freeze 21 | 22 | LOOKUP_POS = [nil] * (1 << (2 * LOOKUP_BITS + 2)) 23 | LOOKUP_IJ = [nil] * (1 << (2 * LOOKUP_BITS + 2)) 24 | 25 | def self.lookup_cells(level, i, j, orig_orientation, pos, orientation) 26 | return lookup_bits(i, j, orig_orientation, pos, orientation) if level == LOOKUP_BITS 27 | 28 | r = POS_TO_IJ[orientation] 29 | 4.times do |index| 30 | lookup_cells( 31 | level + 1, (i << 1) + (r[index] >> 1), (j << 1) + (r[index] & 1), 32 | orig_orientation, (pos << 2) + index, orientation ^ POS_TO_OR[index] 33 | ) 34 | end 35 | end 36 | 37 | def self.lookup_bits(i, j, orig_orientation, pos, orientation) 38 | ij = (i << LOOKUP_BITS) + j 39 | LOOKUP_POS[(ij << 2) + orig_orientation] = (pos << 2) + orientation 40 | LOOKUP_IJ[(pos << 2) + orig_orientation] = (ij << 2) + orientation 41 | end 42 | 43 | lookup_cells(0, 0, 0, 0, 0, 0) 44 | lookup_cells(0, 0, 0, SWAP_MASK, 0, SWAP_MASK) 45 | lookup_cells(0, 0, 0, INVERT_MASK, 0, INVERT_MASK) 46 | lookup_cells(0, 0, 0, SWAP_MASK | INVERT_MASK, 0, SWAP_MASK | INVERT_MASK) 47 | end 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_settings_master_pokemon.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Settings.Master.Pokemon.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_enums' 7 | Google::Protobuf::DescriptorPool.generated_pool.build do 8 | add_message "POGOProtos.Settings.Master.Pokemon.CameraAttributes" do 9 | optional :disk_radius_m, :float, 1 10 | optional :cylinder_radius_m, :float, 2 11 | optional :cylinder_height_m, :float, 3 12 | optional :cylinder_ground_m, :float, 4 13 | optional :shoulder_mode_scale, :float, 5 14 | end 15 | add_message "POGOProtos.Settings.Master.Pokemon.EncounterAttributes" do 16 | optional :base_capture_rate, :float, 1 17 | optional :base_flee_rate, :float, 2 18 | optional :collision_radius_m, :float, 3 19 | optional :collision_height_m, :float, 4 20 | optional :collision_head_radius_m, :float, 5 21 | optional :movement_type, :enum, 6, "POGOProtos.Enums.PokemonMovementType" 22 | optional :movement_timer_s, :float, 7 23 | optional :jump_time_s, :float, 8 24 | optional :attack_timer_s, :float, 9 25 | end 26 | add_message "POGOProtos.Settings.Master.Pokemon.StatsAttributes" do 27 | optional :base_stamina, :int32, 1 28 | optional :base_attack, :int32, 2 29 | optional :base_defense, :int32, 3 30 | optional :dodge_energy_delta, :int32, 8 31 | end 32 | end 33 | 34 | module POGOProtos 35 | module Settings 36 | module Master 37 | module Pokemon 38 | CameraAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Pokemon.CameraAttributes").msgclass 39 | EncounterAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Pokemon.EncounterAttributes").msgclass 40 | StatsAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Pokemon.StatsAttributes").msgclass 41 | end 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /lib/poke-api/helpers.rb: -------------------------------------------------------------------------------- 1 | require 'geocoder' 2 | require 'ruby-xxhash' 3 | 4 | module Poke 5 | module API 6 | class Helpers 7 | class << self 8 | def get_position(pos) 9 | Geocoder.search(pos) 10 | end 11 | 12 | def camel_case_lower(sym) 13 | sym.to_s.split('_').collect(&:capitalize).join 14 | end 15 | 16 | def fetch_time(ms: true) 17 | ms ? (Time.now.to_f * 1000).to_i : Time.now.to_i 18 | end 19 | 20 | def generate_location_one(auth_ticket, pos) 21 | first_hash = XXhash.xxh32(auth_ticket, 0x1B845238) 22 | location_bytes = d2h(pos[0]) + d2h(pos[1]) + d2h(pos[2]) 23 | 24 | XXhash.xxh32(location_bytes, first_hash) 25 | end 26 | 27 | def generate_location_two(pos) 28 | location_bytes = d2h(pos[0]) + d2h(pos[1]) + d2h(pos[2]) 29 | 30 | XXhash.xxh32(location_bytes, 0x1B845238) 31 | end 32 | 33 | def generate_request(auth_ticket, request) 34 | first_hash = XXhash.xxh64(auth_ticket, 0x1B845238) 35 | 36 | XXhash.xxh64(request, first_hash) 37 | end 38 | 39 | def d2h(input) 40 | [input].pack('d').unpack('Q').first.to_s(16).split.pack('H*') 41 | end 42 | 43 | def format_time_diff(low, high, ms = true) 44 | diff = high - low 45 | m, s = ms ? (diff / 1000).divmod(60) : diff.divmod(60) 46 | m.divmod(60) + [s] 47 | end 48 | 49 | def get_cells(lat, lng, radius = 10) 50 | s2_point = Poke::API::Geometry::S2LatLon.new(lat, lng).to_point 51 | s2_cell = Poke::API::Geometry::S2CellId.from_point(s2_point).parent(15) 52 | 53 | next_cell = s2_cell.next 54 | prev_cell = s2_cell.prev 55 | 56 | radius.times.reduce([s2_cell.id]) do |acc, _| 57 | acc += [next_cell.id, prev_cell.id] 58 | next_cell = next_cell.next 59 | prev_cell = prev_cell.prev 60 | acc 61 | end.sort 62 | end 63 | end 64 | end 65 | end 66 | end 67 | -------------------------------------------------------------------------------- /lib/poke-api/auth/ptc.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | require 'uri' 3 | require 'httpclient' 4 | 5 | module Poke 6 | module API 7 | module Auth 8 | class PTC 9 | include Logging 10 | attr_reader :access_token, :provider, :expiry 11 | 12 | PTC_LOGIN_URL = 'https://sso.pokemon.com/sso/login?service=https%3A%2F%2Fsso.pokemon.com' \ 13 | '%2Fsso%2Foauth2.0%2FcallbackAuthorize'.freeze 14 | PTC_LOGIN_OAUTH = 'https://sso.pokemon.com/sso/oauth2.0/accessToken'.freeze 15 | PTC_LOGIN_CLIENT_SECRET = 'w8ScCUXJQc6kXKw8FiOhd8Fixzht18Dq3PEVkUCP5ZPxtgyWsbTvWHFLm2wNY0JR'.freeze 16 | 17 | def initialize(username, password, _refresh_token) 18 | @username = username 19 | @password = password 20 | @provider = 'ptc' 21 | @client = HTTPClient.new(agent_name: 'PokeAPI/0.0.1') 22 | @expiry = 0 23 | end 24 | 25 | def connect 26 | resp = @client.get_content(PTC_LOGIN_URL) 27 | parsed_resp = JSON.parse(resp) 28 | 29 | data = { 30 | username: @username, 31 | password: @password, 32 | _eventId: 'submit', 33 | lt: parsed_resp['lt'], 34 | execution: parsed_resp['execution'] 35 | } 36 | 37 | fetch_ticket(data) 38 | end 39 | 40 | private 41 | 42 | def fetch_ticket(data) 43 | logger.debug '[>] Fetching PTC ticket' 44 | 45 | ticket = begin 46 | @client.post_content(PTC_LOGIN_URL, data) 47 | rescue StandardError => ex 48 | ex.res.http_header.request_uri.to_s.match(/ticket=(.*)/)[1] 49 | end 50 | 51 | fetch_access_token(ticket) 52 | end 53 | 54 | def fetch_access_token(ticket) 55 | logger.debug '[>] Fetching PTC access token' 56 | 57 | data = { 58 | client_id: 'mobile-app_pokemon-go', 59 | redirect_uri: 'https://www.nianticlabs.com/pokemongo/error', 60 | client_secret: PTC_LOGIN_CLIENT_SECRET, 61 | grant_type: 'refresh_token', 62 | code: ticket 63 | } 64 | 65 | resp = Hash[URI.decode_www_form(@client.post(PTC_LOGIN_OAUTH, data).body)] 66 | @access_token = resp['access_token'] 67 | @expiry = resp['expires'].to_i + Helpers.fetch_time(ms: false) 68 | end 69 | end 70 | end 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_data_logs.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Data.Logs.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_enums' 7 | require_relative 'pogoprotos_inventory_item' 8 | Google::Protobuf::DescriptorPool.generated_pool.build do 9 | add_message "POGOProtos.Data.Logs.ActionLogEntry" do 10 | optional :timestamp_ms, :int64, 1 11 | optional :sfida, :bool, 2 12 | oneof :Action do 13 | optional :catch_pokemon, :message, 3, "POGOProtos.Data.Logs.CatchPokemonLogEntry" 14 | optional :fort_search, :message, 4, "POGOProtos.Data.Logs.FortSearchLogEntry" 15 | end 16 | end 17 | add_message "POGOProtos.Data.Logs.CatchPokemonLogEntry" do 18 | optional :result, :enum, 1, "POGOProtos.Data.Logs.CatchPokemonLogEntry.Result" 19 | optional :pokemon_id, :enum, 2, "POGOProtos.Enums.PokemonId" 20 | optional :combat_points, :int32, 3 21 | optional :pokemon_data_id, :fixed64, 4 22 | end 23 | add_enum "POGOProtos.Data.Logs.CatchPokemonLogEntry.Result" do 24 | value :UNSET, 0 25 | value :POKEMON_CAPTURED, 1 26 | value :POKEMON_FLED, 2 27 | value :POKEMON_HATCHED, 3 28 | end 29 | add_message "POGOProtos.Data.Logs.FortSearchLogEntry" do 30 | optional :result, :enum, 1, "POGOProtos.Data.Logs.FortSearchLogEntry.Result" 31 | optional :fort_id, :string, 2 32 | repeated :items, :message, 3, "POGOProtos.Inventory.Item.ItemData" 33 | optional :eggs, :int32, 4 34 | end 35 | add_enum "POGOProtos.Data.Logs.FortSearchLogEntry.Result" do 36 | value :UNSET, 0 37 | value :SUCCESS, 1 38 | end 39 | end 40 | 41 | module POGOProtos 42 | module Data 43 | module Logs 44 | ActionLogEntry = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Logs.ActionLogEntry").msgclass 45 | CatchPokemonLogEntry = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Logs.CatchPokemonLogEntry").msgclass 46 | CatchPokemonLogEntry::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Logs.CatchPokemonLogEntry.Result").enummodule 47 | FortSearchLogEntry = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Logs.FortSearchLogEntry").msgclass 48 | FortSearchLogEntry::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Logs.FortSearchLogEntry.Result").enummodule 49 | end 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /lib/poke-api/errors.rb: -------------------------------------------------------------------------------- 1 | module Poke 2 | module API 3 | class Errors 4 | class InvalidProvider < StandardError 5 | def initialize(provider) 6 | super("Invalid provider #{provider}.") 7 | end 8 | end 9 | 10 | class LoginRequired < StandardError 11 | def initialize 12 | super('Not logged in currently, please login.') 13 | end 14 | end 15 | 16 | class InvalidRequestEntry < StandardError 17 | def initialize(subreq) 18 | super("Subrequest entry #{subreq} is invalid.") 19 | end 20 | end 21 | 22 | class UnknownProtoFault < StandardError 23 | def initialize(error) 24 | super("An unknown proto fault has occured => [#{error} @ #{error.backtrace.first}]") 25 | end 26 | end 27 | 28 | class GoogleAuthenticationFailure < StandardError 29 | def initialize(token, response) 30 | super("Unable to login to Google, could not find => #{token} in #{response}") 31 | end 32 | end 33 | 34 | class GoogleTwoFactorAuthenticationFailure < StandardError 35 | def initialize 36 | super("Two-factor authentication not supported. Create an app-specific password to log in.") 37 | end 38 | end 39 | 40 | class LoginFailure < StandardError 41 | def initialize(provider, error) 42 | super("Unable to login to #{provider} => [#{error} @ #{error.backtrace.first}]") 43 | end 44 | end 45 | 46 | class InvalidEndpoint < StandardError 47 | def initialize 48 | super("Unable to fetch endpoint, please try to login again.") 49 | end 50 | end 51 | 52 | class NoRequests < StandardError 53 | def initialize 54 | super("Can not call without any requests set") 55 | end 56 | end 57 | 58 | class InvalidSignatureFilePath < StandardError 59 | def initialize(file_path) 60 | super("Could not find file #{file_path} for signature generation") 61 | end 62 | end 63 | 64 | class InvalidLevel < StandardError 65 | def initialize(level) 66 | super("Level #{level} is invalid, must be between 0 and 30.") 67 | end 68 | end 69 | 70 | class ForbiddenAccess < StandardError 71 | def initialize 72 | super("Your host is unable to receive a response as it is banned.") 73 | end 74 | end 75 | end 76 | end 77 | end 78 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_inventory_item.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Inventory.Item.proto 3 | 4 | require 'google/protobuf' 5 | 6 | Google::Protobuf::DescriptorPool.generated_pool.build do 7 | add_message "POGOProtos.Inventory.Item.ItemAward" do 8 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 9 | optional :item_count, :int32, 2 10 | end 11 | add_message "POGOProtos.Inventory.Item.ItemData" do 12 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 13 | optional :count, :int32, 2 14 | optional :unseen, :bool, 3 15 | end 16 | add_enum "POGOProtos.Inventory.Item.ItemType" do 17 | value :ITEM_TYPE_NONE, 0 18 | value :ITEM_TYPE_POKEBALL, 1 19 | value :ITEM_TYPE_POTION, 2 20 | value :ITEM_TYPE_REVIVE, 3 21 | value :ITEM_TYPE_MAP, 4 22 | value :ITEM_TYPE_BATTLE, 5 23 | value :ITEM_TYPE_FOOD, 6 24 | value :ITEM_TYPE_CAMERA, 7 25 | value :ITEM_TYPE_DISK, 8 26 | value :ITEM_TYPE_INCUBATOR, 9 27 | value :ITEM_TYPE_INCENSE, 10 28 | value :ITEM_TYPE_XP_BOOST, 11 29 | value :ITEM_TYPE_INVENTORY_UPGRADE, 12 30 | end 31 | add_enum "POGOProtos.Inventory.Item.ItemId" do 32 | value :ITEM_UNKNOWN, 0 33 | value :ITEM_POKE_BALL, 1 34 | value :ITEM_GREAT_BALL, 2 35 | value :ITEM_ULTRA_BALL, 3 36 | value :ITEM_MASTER_BALL, 4 37 | value :ITEM_POTION, 101 38 | value :ITEM_SUPER_POTION, 102 39 | value :ITEM_HYPER_POTION, 103 40 | value :ITEM_MAX_POTION, 104 41 | value :ITEM_REVIVE, 201 42 | value :ITEM_MAX_REVIVE, 202 43 | value :ITEM_LUCKY_EGG, 301 44 | value :ITEM_INCENSE_ORDINARY, 401 45 | value :ITEM_INCENSE_SPICY, 402 46 | value :ITEM_INCENSE_COOL, 403 47 | value :ITEM_INCENSE_FLORAL, 404 48 | value :ITEM_TROY_DISK, 501 49 | value :ITEM_X_ATTACK, 602 50 | value :ITEM_X_DEFENSE, 603 51 | value :ITEM_X_MIRACLE, 604 52 | value :ITEM_RAZZ_BERRY, 701 53 | value :ITEM_BLUK_BERRY, 702 54 | value :ITEM_NANAB_BERRY, 703 55 | value :ITEM_WEPAR_BERRY, 704 56 | value :ITEM_PINAP_BERRY, 705 57 | value :ITEM_SPECIAL_CAMERA, 801 58 | value :ITEM_INCUBATOR_BASIC_UNLIMITED, 901 59 | value :ITEM_INCUBATOR_BASIC, 902 60 | value :ITEM_POKEMON_STORAGE_UPGRADE, 1001 61 | value :ITEM_ITEM_STORAGE_UPGRADE, 1002 62 | end 63 | end 64 | 65 | module POGOProtos 66 | module Inventory 67 | module Item 68 | ItemAward = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.Item.ItemAward").msgclass 69 | ItemData = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.Item.ItemData").msgclass 70 | ItemType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.Item.ItemType").enummodule 71 | ItemId = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.Item.ItemId").enummodule 72 | end 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /lib/poke-api/auth/google.rb: -------------------------------------------------------------------------------- 1 | require 'gpsoauth' 2 | 3 | module Poke 4 | module API 5 | module Auth 6 | class GOOGLE 7 | include Logging 8 | attr_reader :access_token, :provider, :expiry 9 | 10 | GOOGLE_LOGIN_ANDROID_ID = '9774d56d682e549c'.freeze 11 | GOOGLE_LOGIN_SERVICE = 'audience:server:client_id:848232511240-7so421jotr' \ 12 | '2609rmqakceuu1luuq0ptb.apps.googleusercontent.com'.freeze 13 | GOOGLE_LOGIN_APP = 'com.nianticlabs.pokemongo'.freeze 14 | GOOGLE_LOGIN_CLIENT_SIG = '321187995bc7cdc2b5fc91b11a96e2baa8602c62'.freeze 15 | 16 | def initialize(username, password, refresh_token) 17 | @refresh_token = refresh_token 18 | @username = username 19 | @password = password 20 | @provider = 'google' 21 | @expiry = 0 22 | end 23 | 24 | def connect 25 | return access_token_from_refresh_token if @refresh_token 26 | logger.debug '[>] Fetching Google access token' 27 | 28 | token_request = perform_request('Token') do 29 | Gpsoauth::Auth.performMasterLogin(@username, @password, GOOGLE_LOGIN_ANDROID_ID) 30 | end 31 | 32 | auth_request = perform_request('Auth') do 33 | Gpsoauth::Auth.performOAuth(@username, token_request['Token'], GOOGLE_LOGIN_ANDROID_ID, 34 | GOOGLE_LOGIN_SERVICE, GOOGLE_LOGIN_APP, GOOGLE_LOGIN_CLIENT_SIG) 35 | end 36 | 37 | @expiry = auth_request['Expiry'].to_i 38 | @access_token = auth_request['Auth'] 39 | end 40 | 41 | private 42 | 43 | def access_token_from_refresh_token 44 | logger.info '[>] Fetching Google access token from refresh token' 45 | 46 | body = { 47 | grant_type: 'refresh_token', 48 | redirect_uri: 'urn:ietf:wg:oauth:2.0:oob', 49 | refresh_token: @refresh_token, 50 | scope: 'email', 51 | client_secret: 'NCjF1TLi2CcY6t5mt0ZveuL7', 52 | client_id: '848232511240-73ri3t7plvk96pj4f85uj8otdat2alem.apps.googleusercontent.com', 53 | } 54 | 55 | resp = HTTPClient.new.post('https://accounts.google.com/o/oauth2/token', body).body 56 | data = JSON.parse(resp) 57 | 58 | @access_token = data['id_token'] 59 | @expiry = data['expires_in'].to_i + Helpers.fetch_time(ms: false) 60 | 61 | raise 'Invalid refresh token' unless data['id_token'] 62 | end 63 | 64 | def perform_request(method) 65 | response = yield 66 | 67 | if response['Error'] == 'NeedsBrowser' 68 | raise Errors::GoogleTwoFactorAuthenticationFailure 69 | else 70 | unless response['Token'] || response['Auth'] 71 | raise Errors::GoogleAuthenticationFailure.new(method, response) 72 | end 73 | end 74 | 75 | response 76 | end 77 | end 78 | end 79 | end 80 | end 81 | -------------------------------------------------------------------------------- /lib/poke-api/signature.rb: -------------------------------------------------------------------------------- 1 | require 'fiddle' 2 | require 'fiddle/import' 3 | 4 | module Poke 5 | module API 6 | module Signature 7 | extend Fiddle::Importer 8 | extend Logging 9 | 10 | def self.load_signature(client) 11 | dlload client.sig_path 12 | extern "int encrypt(const unsigned char *input, size_t input_size," \ 13 | " const unsigned char* iv, size_t iv_size, unsigned char* " \ 14 | "output, size_t * output_size)" 15 | logger.info '[+] Loaded Signature module' 16 | client.sig_loaded = true 17 | end 18 | 19 | def self.generate_signature(signature) 20 | output_size = Fiddle::Pointer.malloc(1) 21 | 22 | iv = SecureRandom.random_bytes(32) 23 | encrypt(signature, signature.length, iv, 32, nil, output_size) 24 | 25 | output = Fiddle::Pointer.malloc(288) 26 | encrypt(signature, signature.length, iv, 32, output, output_size) 27 | 28 | logger.debug "[+] Generated Encrypted Signature \r\n#{output.to_str.inspect}" 29 | 30 | output.to_str 31 | end 32 | 33 | def self.create_signature(req, req_client, api_client) 34 | signature = POGOProtos::Networking::Envelopes::Signature.new( 35 | location_hash1: Helpers.generate_location_one(req.auth_ticket.to_proto, req_client.position), 36 | location_hash2: Helpers.generate_location_two(req_client.position), 37 | unknown25: -8537042734809897855, 38 | timestamp: Helpers.fetch_time, 39 | timestamp_since_start: Helpers.fetch_time - req_client.start_time 40 | ) 41 | 42 | add_requests(req, signature) 43 | add_optional_signature_information(signature, api_client) 44 | 45 | logger.debug "[+] Generated Signature \r\n#{signature.inspect}" 46 | logger.debug "[+] Generated Protobuf Signature \r\n#{signature.to_proto.inspect}" 47 | add_unknown6(req, signature) 48 | end 49 | 50 | def self.add_requests(req, signature) 51 | req.requests.each do |r| 52 | signature.request_hash << Helpers.generate_request(req.auth_ticket.to_proto, r.to_proto) 53 | end 54 | end 55 | 56 | def self.add_unknown6(req, signature) 57 | req.unknown6 = POGOProtos::Networking::Envelopes::Unknown6.new( 58 | request_type: 6, 59 | unknown2: POGOProtos::Networking::Envelopes::Unknown6::Unknown2.new( 60 | encrypted_signature: generate_signature(signature.to_proto) 61 | ) 62 | ) 63 | end 64 | 65 | def self.add_optional_signature_information(sig, api_client) 66 | %i(android_gps_info sensor_info device_info activity_status location_fix).each do |i| 67 | name = Helpers.camel_case_lower(i) 68 | 69 | if api_client.send(i) 70 | message = add_optional_information(name, api_client.send(i)) 71 | i == :location_fix ? (sig.send(i) << message) : sig.send("#{i.to_s}=", message) 72 | end 73 | end 74 | end 75 | 76 | def self.add_optional_information(name, client_info) 77 | info_class = POGOProtos::Networking::Envelopes::Signature.const_get(name) 78 | info_class.new(client_info) 79 | end 80 | 81 | private_class_method :add_requests, :add_unknown6 82 | end 83 | end 84 | end 85 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_map_fort.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Map.Fort.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_inventory_item' 7 | require_relative 'pogoprotos_enums' 8 | Google::Protobuf::DescriptorPool.generated_pool.build do 9 | add_message "POGOProtos.Map.Fort.FortSummary" do 10 | optional :fort_summary_id, :string, 1 11 | optional :last_modified_timestamp_ms, :int64, 2 12 | optional :latitude, :double, 3 13 | optional :longitude, :double, 4 14 | end 15 | add_message "POGOProtos.Map.Fort.FortModifier" do 16 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 17 | optional :expiration_timestamp_ms, :int64, 2 18 | optional :deployer_player_codename, :string, 3 19 | end 20 | add_message "POGOProtos.Map.Fort.FortData" do 21 | optional :id, :string, 1 22 | optional :last_modified_timestamp_ms, :int64, 2 23 | optional :latitude, :double, 3 24 | optional :longitude, :double, 4 25 | optional :enabled, :bool, 8 26 | optional :type, :enum, 9, "POGOProtos.Map.Fort.FortType" 27 | optional :owned_by_team, :enum, 5, "POGOProtos.Enums.TeamColor" 28 | optional :guard_pokemon_id, :enum, 6, "POGOProtos.Enums.PokemonId" 29 | optional :guard_pokemon_cp, :int32, 7 30 | optional :gym_points, :int64, 10 31 | optional :is_in_battle, :bool, 11 32 | repeated :active_fort_modifier, :enum, 12, "POGOProtos.Inventory.Item.ItemId" 33 | optional :lure_info, :message, 13, "POGOProtos.Map.Fort.FortLureInfo" 34 | optional :cooldown_complete_timestamp_ms, :int64, 14 35 | optional :sponsor, :enum, 15, "POGOProtos.Map.Fort.FortSponsor" 36 | optional :rendering_type, :enum, 16, "POGOProtos.Map.Fort.FortRenderingType" 37 | end 38 | add_message "POGOProtos.Map.Fort.FortLureInfo" do 39 | optional :fort_id, :string, 1 40 | optional :encounter_id, :fixed64, 2 41 | optional :active_pokemon_id, :enum, 3, "POGOProtos.Enums.PokemonId" 42 | optional :lure_expires_timestamp_ms, :int64, 4 43 | end 44 | add_enum "POGOProtos.Map.Fort.FortType" do 45 | value :GYM, 0 46 | value :CHECKPOINT, 1 47 | end 48 | add_enum "POGOProtos.Map.Fort.FortSponsor" do 49 | value :UNSET_SPONSOR, 0 50 | value :MCDONALDS, 1 51 | value :POKEMON_STORE, 2 52 | end 53 | add_enum "POGOProtos.Map.Fort.FortRenderingType" do 54 | value :DEFAULT, 0 55 | value :INTERNAL_TEST, 1 56 | end 57 | end 58 | 59 | module POGOProtos 60 | module Map 61 | module Fort 62 | FortSummary = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Fort.FortSummary").msgclass 63 | FortModifier = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Fort.FortModifier").msgclass 64 | FortData = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Fort.FortData").msgclass 65 | FortLureInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Fort.FortLureInfo").msgclass 66 | FortType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Fort.FortType").enummodule 67 | FortSponsor = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Fort.FortSponsor").enummodule 68 | FortRenderingType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Map.Fort.FortRenderingType").enummodule 69 | end 70 | end 71 | end 72 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_settings.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Settings.proto 3 | 4 | require 'google/protobuf' 5 | 6 | Google::Protobuf::DescriptorPool.generated_pool.build do 7 | add_message "POGOProtos.Settings.MapSettings" do 8 | optional :pokemon_visible_range, :double, 1 9 | optional :poke_nav_range_meters, :double, 2 10 | optional :encounter_range_meters, :double, 3 11 | optional :get_map_objects_min_refresh_seconds, :float, 4 12 | optional :get_map_objects_max_refresh_seconds, :float, 5 13 | optional :get_map_objects_min_distance_meters, :float, 6 14 | optional :google_maps_api_key, :string, 7 15 | end 16 | add_message "POGOProtos.Settings.FortSettings" do 17 | optional :interaction_range_meters, :double, 1 18 | optional :max_total_deployed_pokemon, :int32, 2 19 | optional :max_player_deployed_pokemon, :int32, 3 20 | optional :deploy_stamina_multiplier, :double, 4 21 | optional :deploy_attack_multiplier, :double, 5 22 | optional :far_interaction_range_meters, :double, 6 23 | end 24 | add_message "POGOProtos.Settings.GpsSettings" do 25 | optional :driving_warning_speed_meters_per_second, :float, 1 26 | optional :driving_warning_cooldown_minutes, :float, 2 27 | optional :driving_speed_sample_interval_seconds, :float, 3 28 | optional :driving_speed_sample_count, :int32, 4 29 | end 30 | add_message "POGOProtos.Settings.GlobalSettings" do 31 | optional :fort_settings, :message, 2, "POGOProtos.Settings.FortSettings" 32 | optional :map_settings, :message, 3, "POGOProtos.Settings.MapSettings" 33 | optional :level_settings, :message, 4, "POGOProtos.Settings.LevelSettings" 34 | optional :inventory_settings, :message, 5, "POGOProtos.Settings.InventorySettings" 35 | optional :minimum_client_version, :string, 6 36 | optional :gps_settings, :message, 7, "POGOProtos.Settings.GpsSettings" 37 | end 38 | add_message "POGOProtos.Settings.InventorySettings" do 39 | optional :max_pokemon, :int32, 1 40 | optional :max_bag_items, :int32, 2 41 | optional :base_pokemon, :int32, 3 42 | optional :base_bag_items, :int32, 4 43 | optional :base_eggs, :int32, 5 44 | end 45 | add_message "POGOProtos.Settings.LevelSettings" do 46 | optional :trainer_cp_modifier, :double, 2 47 | optional :trainer_difficulty_modifier, :double, 3 48 | end 49 | add_message "POGOProtos.Settings.DownloadSettingsAction" do 50 | optional :hash, :string, 1 51 | end 52 | end 53 | 54 | module POGOProtos 55 | module Settings 56 | MapSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.MapSettings").msgclass 57 | FortSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.FortSettings").msgclass 58 | GpsSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.GpsSettings").msgclass 59 | GlobalSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.GlobalSettings").msgclass 60 | InventorySettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.InventorySettings").msgclass 61 | LevelSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.LevelSettings").msgclass 62 | DownloadSettingsAction = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.DownloadSettingsAction").msgclass 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_networking_requests.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Networking.Requests.proto 3 | 4 | require 'google/protobuf' 5 | 6 | Google::Protobuf::DescriptorPool.generated_pool.build do 7 | add_message "POGOProtos.Networking.Requests.Request" do 8 | optional :request_type, :enum, 1, "POGOProtos.Networking.Requests.RequestType" 9 | optional :request_message, :bytes, 2 10 | end 11 | add_enum "POGOProtos.Networking.Requests.RequestType" do 12 | value :METHOD_UNSET, 0 13 | value :PLAYER_UPDATE, 1 14 | value :GET_PLAYER, 2 15 | value :GET_INVENTORY, 4 16 | value :DOWNLOAD_SETTINGS, 5 17 | value :DOWNLOAD_ITEM_TEMPLATES, 6 18 | value :DOWNLOAD_REMOTE_CONFIG_VERSION, 7 19 | value :FORT_SEARCH, 101 20 | value :ENCOUNTER, 102 21 | value :CATCH_POKEMON, 103 22 | value :FORT_DETAILS, 104 23 | value :ITEM_USE, 105 24 | value :GET_MAP_OBJECTS, 106 25 | value :FORT_DEPLOY_POKEMON, 110 26 | value :FORT_RECALL_POKEMON, 111 27 | value :RELEASE_POKEMON, 112 28 | value :USE_ITEM_POTION, 113 29 | value :USE_ITEM_CAPTURE, 114 30 | value :USE_ITEM_FLEE, 115 31 | value :USE_ITEM_REVIVE, 116 32 | value :TRADE_SEARCH, 117 33 | value :TRADE_OFFER, 118 34 | value :TRADE_RESPONSE, 119 35 | value :TRADE_RESULT, 120 36 | value :GET_PLAYER_PROFILE, 121 37 | value :GET_ITEM_PACK, 122 38 | value :BUY_ITEM_PACK, 123 39 | value :BUY_GEM_PACK, 124 40 | value :EVOLVE_POKEMON, 125 41 | value :GET_HATCHED_EGGS, 126 42 | value :ENCOUNTER_TUTORIAL_COMPLETE, 127 43 | value :LEVEL_UP_REWARDS, 128 44 | value :CHECK_AWARDED_BADGES, 129 45 | value :USE_ITEM_GYM, 133 46 | value :GET_GYM_DETAILS, 134 47 | value :START_GYM_BATTLE, 135 48 | value :ATTACK_GYM, 136 49 | value :RECYCLE_INVENTORY_ITEM, 137 50 | value :COLLECT_DAILY_BONUS, 138 51 | value :USE_ITEM_XP_BOOST, 139 52 | value :USE_ITEM_EGG_INCUBATOR, 140 53 | value :USE_INCENSE, 141 54 | value :GET_INCENSE_POKEMON, 142 55 | value :INCENSE_ENCOUNTER, 143 56 | value :ADD_FORT_MODIFIER, 144 57 | value :DISK_ENCOUNTER, 145 58 | value :COLLECT_DAILY_DEFENDER_BONUS, 146 59 | value :UPGRADE_POKEMON, 147 60 | value :SET_FAVORITE_POKEMON, 148 61 | value :NICKNAME_POKEMON, 149 62 | value :EQUIP_BADGE, 150 63 | value :SET_CONTACT_SETTINGS, 151 64 | value :GET_ASSET_DIGEST, 300 65 | value :GET_DOWNLOAD_URLS, 301 66 | value :GET_SUGGESTED_CODENAMES, 401 67 | value :CHECK_CODENAME_AVAILABLE, 402 68 | value :CLAIM_CODENAME, 403 69 | value :SET_AVATAR, 404 70 | value :SET_PLAYER_TEAM, 405 71 | value :MARK_TUTORIAL_COMPLETE, 406 72 | value :LOAD_SPAWN_POINTS, 500 73 | value :ECHO, 666 74 | value :DEBUG_UPDATE_INVENTORY, 700 75 | value :DEBUG_DELETE_PLAYER, 701 76 | value :SFIDA_REGISTRATION, 800 77 | value :SFIDA_ACTION_LOG, 801 78 | value :SFIDA_CERTIFICATION, 802 79 | value :SFIDA_UPDATE, 803 80 | value :SFIDA_ACTION, 804 81 | value :SFIDA_DOWSER, 805 82 | value :SFIDA_CAPTURE, 806 83 | end 84 | end 85 | 86 | module POGOProtos 87 | module Networking 88 | module Requests 89 | Request = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Request").msgclass 90 | RequestType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.RequestType").enummodule 91 | end 92 | end 93 | end 94 | -------------------------------------------------------------------------------- /lib/poke-api/response.rb: -------------------------------------------------------------------------------- 1 | module Poke 2 | module API 3 | class Response 4 | include Logging 5 | attr_reader :response, :request 6 | 7 | def initialize(response, request) 8 | @response = response 9 | @request = request 10 | end 11 | 12 | def decode(client) 13 | logger.info '[+] Decoding Main RPC responses' 14 | logger.debug "[+] RPC response \r\n#{@response.inspect}" 15 | 16 | @response = POGOProtos::Networking::Envelopes::ResponseEnvelope.decode(@response) 17 | logger.debug "[+] Decoded RPC response \r\n#{@response.inspect}" 18 | 19 | store_ticket(client) 20 | store_endpoint(client) 21 | 22 | decode_response 23 | end 24 | 25 | private 26 | 27 | def decode_response 28 | logger.info '[+] Decoding Sub RPC responses' 29 | decoded_resp = parse_rpc_fields(decode_sub_responses) 30 | 31 | loop do 32 | break unless decoded_resp.to_s.include?('POGOProtos::') 33 | parse_rpc_fields(decoded_resp) 34 | end 35 | 36 | decoded_resp.merge!(status_code: @response.status_code, 37 | api_url: @response.api_url, error: @response.error) 38 | 39 | @response = decoded_resp 40 | logger.debug "[+] Returned RPC response \r\n#{@response}" 41 | end 42 | 43 | def store_ticket(client) 44 | return unless @response.auth_ticket 45 | auth = @response.auth_ticket.to_hash 46 | 47 | if client.ticket.is_new_ticket?(auth[:expire_timestamp_ms]) 48 | logger.info "[+] Using auth ticket instead" 49 | logger.debug "[+] Storing auth ticket\r\n#{auth}" 50 | client.ticket.set_ticket(auth) 51 | end 52 | end 53 | 54 | def store_endpoint(client) 55 | logger.debug "[+] Current endpoint #{client.endpoint}" 56 | 57 | if client.endpoint == 'https://pgorelease.nianticlabs.com/plfe/rpc' 58 | raise Errors::InvalidEndpoint if @response.api_url.empty? 59 | end 60 | 61 | return if @response.api_url.empty? 62 | 63 | logger.debug "[+] Setting endpoint to https://#{@response.api_url}/rpc" 64 | client.endpoint = "https://#{@response.api_url}/rpc" 65 | end 66 | 67 | def decode_sub_responses 68 | @response.returns.zip(@request).each_with_object({}) do |(resp, req), memo| 69 | logger.debug "[+] Decoding Sub RPC response for #{req}\r\n#{resp.inspect}" 70 | proto_name, entry_name = fetch_proto_response_metadata(req) 71 | 72 | response = begin 73 | POGOProtos::Networking::Responses.const_get(proto_name).decode(resp).to_hash 74 | rescue StandardError 75 | logger.error "[+] Protobuf definition mismatch/not found for #{entry_name}" 76 | 'Mismatched/Invalid Protobuf Definition' 77 | end 78 | 79 | logger.debug "[+] Decoded Sub RPC response \r\n#{response.inspect}" 80 | memo[entry_name] = response 81 | end 82 | end 83 | 84 | def fetch_proto_response_metadata(req) 85 | entry_name = req.is_a?(Symbol) ? req : req.keys.first 86 | proto_name = Poke::API::Helpers.camel_case_lower(entry_name) + 'Response' 87 | 88 | [proto_name, entry_name] 89 | end 90 | 91 | def parse_rpc_fields(responses) 92 | responses.map! do |x| 93 | x = x.to_hash if x.class.name =~ /POGOProtos/ 94 | x 95 | end if responses.is_a?(Array) 96 | 97 | responses.each do |k, v| 98 | parse_rpc_fields(v) if [Hash, Array].include?(v.class) 99 | parse_rpc_fields(k) if [Hash, Array].include?(k.class) 100 | 101 | responses[k] = v.to_hash if v.class.name =~ /POGOProtos/ 102 | end 103 | end 104 | end 105 | end 106 | end 107 | -------------------------------------------------------------------------------- /examples/spiral_search.rb: -------------------------------------------------------------------------------- 1 | require 'pp' 2 | require 'poke-api' 3 | 4 | def generate_spiral(starting_lat, starting_lng, step_size, step_limit) 5 | coords = [{ lat: starting_lat, lng: starting_lng }] 6 | steps = 1 7 | x = 0 8 | y = 0 9 | d = 1 10 | m = 1 11 | rlow = 0.0 12 | rhigh = 0.0005 13 | 14 | while steps < step_limit 15 | while 2 * x * d < m && steps < step_limit 16 | x += d 17 | steps += 1 18 | lat = x * step_size + starting_lat + rand * ((rlow - rhigh) + rlow) 19 | lng = y * step_size + starting_lng + rand * ((rlow - rhigh) + rlow) 20 | coords << { lat: lat, lng: lng } 21 | end 22 | while 2 * y * d < m && steps < step_limit 23 | y += d 24 | steps += 1 25 | lat = x * step_size + starting_lat + rand * ((rlow - rhigh) + rlow) 26 | lng = y * step_size + starting_lng + rand * ((rlow - rhigh) + rlow) 27 | coords << { lat: lat, lng: lng } 28 | end 29 | 30 | d = -1 * d 31 | m += 1 32 | end 33 | 34 | coords 35 | end 36 | 37 | def print_google_maps_path(coords) 38 | url_string = 'http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=' 39 | coords.each { |c| url_string += "#{c[:lat]},#{c[:lng]}|" } 40 | 41 | path = HTTPClient.new.get("http://tinyurl.com/api-create.php?url=#{url_string[0..-2]}").body 42 | puts "Spiral path on Google Maps: #{path}" 43 | end 44 | 45 | def find_poi(client, lat, lng) 46 | step_size = 0.0015 47 | step_limit = 49 48 | 49 | coords = generate_spiral(lat, lng, step_size, step_limit) 50 | print_google_maps_path(coords) 51 | 52 | pokemon_data = {} 53 | 54 | coords.each do |coord| 55 | lat = coord[:lat] 56 | lng = coord[:lng] 57 | client.store_lat_lng(lat, lng) 58 | 59 | cell_ids = Poke::API::Helpers.get_cells(lat, lng) 60 | 61 | client.get_map_objects( 62 | latitude: client.lat, 63 | longitude: client.lng, 64 | since_timestamp_ms: [0] * cell_ids.length, 65 | cell_id: cell_ids 66 | ) 67 | 68 | resp = client.call 69 | puts "\nSearching at lat: #{lat} lng: #{lng}" 70 | 71 | if resp.response[:GET_MAP_OBJECTS] && resp.response[:GET_MAP_OBJECTS][:map_cells] 72 | wild_pokemons = resp.response[:GET_MAP_OBJECTS][:map_cells].map { |x| x[:wild_pokemons] }.flatten 73 | wild_pokemons.each do |pokemon| 74 | poke_data = { 75 | 'name' => pokemon[:pokemon_data][:pokemon_id], 76 | 'lat' => pokemon[:latitude], 77 | 'lng' => pokemon[:longitude], 78 | 'time_stamp' => pokemon[:last_modified_timestamp_ms], 79 | 'time_left' => pokemon[:time_till_hidden_ms] / 1000 80 | } 81 | 82 | # Don't show the same pokemon again 83 | unless pokemon_data[pokemon[:encounter_id]] 84 | puts '' 85 | pp poke_data 86 | end 87 | 88 | pokemon_data[pokemon[:encounter_id]] = poke_data 89 | end 90 | end 91 | 92 | # Save our data somewhere 93 | File.open('pokemon_data.json', 'w') { |f| f.write JSON.pretty_generate(pokemon_data) } 94 | sleep 5 95 | end 96 | end 97 | 98 | # Disable logging as it'll just be spammy 99 | Poke::API::Logging.log_level = :UNKNOWN 100 | 101 | # Instatiate our client 102 | client = Poke::API::Client.new 103 | 104 | # Set our location 105 | client.store_location('New York') 106 | 107 | # Login 108 | client.login('username', 'password', 'ptc') 109 | 110 | # Active signature as required for map_objects 111 | client.activate_signature('/path/to/encrypt/file') 112 | 113 | # Start spiral search 114 | find_poi(client, client.lat, client.lng) 115 | 116 | # You can implement your own logic to split each iteration of 117 | # coords into its own thread using multiple logins with multi 118 | # threading. You would need to utilize Mutex to ensure the data 119 | # is thread-safe. A database can also be implemented instead of 120 | # using a file to read/write from. 121 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Changelog 2 | ------------------ 3 | 0.2.1 (21-08-2016) 4 | ------------------ 5 | * **Revert** - Initial ticket is reverted back to ``get_hatched_eggs`` as Niantic may detect someone constantly accepting TOS whereas this is only possible once in game. Accepting TOS is out of bounds for the API client (however it is possible to add the request for TOS before logging in as per usual methods) 6 | 7 | 0.2.0 (21-08-2016) 8 | ------------------ 9 | * **Fix** - Fixed an issue whereby ``to_h`` was called causing Ruby 2.0.0 to not work. 10 | * **Change** - The initial ticket will always request to mark tutorial as complete (this supports new PTC accounts out of the box without accepting TOS) 11 | * **Feature** - You can now provide the following optional information in the client constructor: ``:android_gps_info``, ``:sensor_info``, ``:device_info``,``:activity_status`` and ``:location_fix`` 12 | 13 | 0.1.7 (10-08-2016) 14 | ------------------ 15 | * **Feature** - You can now provide a ``HTTPClient`` instantation for proxy purposes 16 | * **Feature** - A Google refresh token can now be set using ``refresh_token`` setter method (i.e. ``client.refresh_token = 'my_refresh_token'``). The refresh token will always be used first (you can leave out the username and password as empty strings) 17 | 18 | 0.1.5 (09-08-2016) 19 | ------------------ 20 | * **Feature** - Access tokens and authentication tickets will automatically refresh upon expiry 21 | * **Feature** - S2 Geometry cell has been added to the helper method ``Poke::API::Helpers.get_cells(...)`` 22 | * **New Protobufs** - Protocol Buffers have been updated to the latest version and minified as possible 23 | 24 | 0.1.1 (08-08-2016) 25 | ------------------ 26 | * **Fix** - Fixed an issue whereby path was incorrectly referenced as a variable 27 | * **Change** - FFI is no longer required, built-in Ruby's Fiddle is used instead (and appears more reliable) 28 | 29 | 0.1.0 (07-08-2016) 30 | ------------------ 31 | * **Fix** - Include the new signature generation, requires your own encrypt file (dll/so) 32 | * **Feature** - Classes have been added to generate S2 Cell Ids in native Ruby (no external libraries), this covers the base S2 features and may not include advanced methods yet. 33 | 34 | 0.0.8 (03-08-2016) 35 | ------------------ 36 | * **Fix** - Ensure the endpoint is constantly updated if a new one is provided 37 | 38 | 0.0.7 (01-08-2016) 39 | ------------------ 40 | * **Fix** - Fix an issue whereby the @endpoint address was overwritten to an empty string on a failed login attempt 41 | * **Feature** - A new function ``store_lat_lng`` is provided to store a latitude and longitude directly (without requiring Geocoder to look up) 42 | 43 | 0.0.6 (31-07-2016) 44 | ------------------ 45 | * **Fix** - Merged [PR](https://github.com/nabeelamjad/poke-api/pull/19) to fix upcase! and added additional error handling for Google 46 | 47 | 0.0.5 (30-07-2016) 48 | ------------------ 49 | * **Fix** - An issue with upcase! was resolved as described by [this PR](https://github.com/nabeelamjad/poke-api/pull/18) 50 | 51 | 0.0.4 (27-07-2016) 52 | ------------------ 53 | * **Fix** - GPSOAuth has been updated so that older versions of Ruby do not break when using Google login 54 | * **Feature** - Response now returns two additional messages for ``status_code`` and ``error` 55 | * *status_code*: indicates the response status code 56 | * *error*: returns the error or an empty string 57 | 58 | 0.0.3 (27-07-2016) 59 | ------------------ 60 | * **New Protobufs** - Protobufs have been updated to commit [`b2c48b17b`](https://github.com/AeonLucid/POGOProtos/tree/b2c48b17b560dc3d259d50a8afa1ef4199170bc4) 61 | 62 | 0.0.2 (25-07-2016) 63 | ------------------ 64 | 65 | * **Feature** - Google Login is now supported 66 | * **GetMapObjects** - A workaround has been added to README on how to obtain these using Ruby and Python together and it also documented in [**`example.rb`**](example.rb). 67 | 68 | 69 | 0.0.1 (22-07-2016) 70 | ------------------ 71 | 72 | * Initial release of an API library gem for Pokémon GO. 73 | -------------------------------------------------------------------------------- /lib/poke-api/client.rb: -------------------------------------------------------------------------------- 1 | module Poke 2 | module API 3 | class Client 4 | include Logging 5 | attr_accessor :endpoint, :sig_loaded, :refresh_token, 6 | :lat, :lng, :alt, :http_client, :ticket, 7 | :android_gps_info, :sensor_info, :device_info, 8 | :activity_status, :location_fix 9 | attr_reader :sig_path, :auth 10 | 11 | def initialize 12 | @endpoint = 'https://pgorelease.nianticlabs.com/plfe/rpc' 13 | @reqs = [] 14 | @lat = 0 15 | @lng = 0 16 | @alt = rand(1..9) 17 | @ticket = Auth::Ticket.new 18 | @sig_loaded = false 19 | end 20 | 21 | def login(username, password, provider) 22 | @username, @password, @provider = username, password, provider.upcase 23 | raise Errors::InvalidProvider, provider unless %w(PTC GOOGLE).include?(@provider) 24 | 25 | begin 26 | @auth = Auth.const_get(@provider).new(@username, @password, @refresh_token) 27 | @auth.connect 28 | rescue StandardError => ex 29 | raise Errors::LoginFailure.new(@provider, ex) 30 | end 31 | 32 | initialize_ticket 33 | logger.info "[+] Login with #{@provider} Successful" 34 | end 35 | 36 | def call 37 | raise Errors::LoginRequired unless @auth 38 | raise Errors::NoRequests if @reqs.empty? 39 | 40 | check_expiry 41 | req = RequestBuilder.new(@auth, [@lat, @lng, @alt], @endpoint, @http_client) 42 | 43 | begin 44 | resp = req.request(@reqs, self) 45 | rescue StandardError => ex 46 | error(ex) 47 | ensure 48 | @reqs = [] 49 | logger.info '[+] Cleaning up RPC requests' 50 | end 51 | 52 | resp 53 | end 54 | 55 | def activate_signature(file_path) 56 | if File.exist?(file_path) 57 | logger.info "[+] File #{file_path} has been set for signature generation" 58 | @sig_path = file_path 59 | else 60 | raise Errors::InvalidSignatureFilePath, file_path 61 | end 62 | end 63 | 64 | def store_location(loc) 65 | pos = Poke::API::Helpers.get_position(loc).first 66 | logger.info "[+] Given location: #{pos.address}" 67 | 68 | logger.info "[+] Lat/Long/Alt: #{pos.latitude}, #{pos.longitude}" 69 | @lat, @lng = pos.latitude, pos.longitude 70 | end 71 | 72 | def store_lat_lng(lat, lng) 73 | logger.info "[+] Lat/Long: #{lat}, #{lng}" 74 | @lat, @lng = lat, lng 75 | end 76 | 77 | def inspect 78 | "#<#{self.class.name} @auth=#{@auth} @reqs=#{@reqs} " \ 79 | "@lat=#{@lat} @lng=#{@lng} @alt=#{@alt}>" 80 | end 81 | 82 | private 83 | 84 | def initialize_ticket 85 | get_hatched_eggs 86 | call 87 | end 88 | 89 | def check_expiry 90 | unless @ticket.has_ticket? 91 | now = Helpers.fetch_time(ms: false) 92 | 93 | if now < (@auth.expiry - 30) 94 | duration = format('%02d:%02d:%02d', *Helpers.format_time_diff(now, @auth.expiry, false)) 95 | logger.info "[+] Provider access token is valid for #{duration}" 96 | return 97 | end 98 | 99 | logger.info "[+] Refreshing access token as it is no longer valid" 100 | login(@username, @password, @provider) 101 | end 102 | end 103 | 104 | def error(ex) 105 | if Poke::API::Errors.constants.include?(ex.class.to_s.split('::').last.to_sym) 106 | raise ex.class 107 | end 108 | 109 | raise Errors::UnknownProtoFault, ex 110 | end 111 | 112 | def method_missing(method, *args) 113 | POGOProtos::Networking::Requests::RequestType.const_get(method.upcase) 114 | @reqs << (args.empty? ? method.to_sym.upcase : { method.to_sym.upcase => args.first }) 115 | rescue NameError 116 | super 117 | end 118 | end 119 | end 120 | end 121 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_data_player.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Data.Player.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_enums' 7 | Google::Protobuf::DescriptorPool.generated_pool.build do 8 | add_message "POGOProtos.Data.Player.Currency" do 9 | optional :name, :string, 1 10 | optional :amount, :int32, 2 11 | end 12 | add_message "POGOProtos.Data.Player.PlayerCurrency" do 13 | optional :gems, :int32, 1 14 | end 15 | add_message "POGOProtos.Data.Player.DailyBonus" do 16 | optional :next_collected_timestamp_ms, :int64, 1 17 | optional :next_defender_bonus_collect_timestamp_ms, :int64, 2 18 | end 19 | add_message "POGOProtos.Data.Player.PlayerStats" do 20 | optional :level, :int32, 1 21 | optional :experience, :int64, 2 22 | optional :prev_level_xp, :int64, 3 23 | optional :next_level_xp, :int64, 4 24 | optional :km_walked, :float, 5 25 | optional :pokemons_encountered, :int32, 6 26 | optional :unique_pokedex_entries, :int32, 7 27 | optional :pokemons_captured, :int32, 8 28 | optional :evolutions, :int32, 9 29 | optional :poke_stop_visits, :int32, 10 30 | optional :pokeballs_thrown, :int32, 11 31 | optional :eggs_hatched, :int32, 12 32 | optional :big_magikarp_caught, :int32, 13 33 | optional :battle_attack_won, :int32, 14 34 | optional :battle_attack_total, :int32, 15 35 | optional :battle_defended_won, :int32, 16 36 | optional :battle_training_won, :int32, 17 37 | optional :battle_training_total, :int32, 18 38 | optional :prestige_raised_total, :int32, 19 39 | optional :prestige_dropped_total, :int32, 20 40 | optional :pokemon_deployed, :int32, 21 41 | optional :pokemon_caught_by_type, :bytes, 22 42 | optional :small_rattata_caught, :int32, 23 43 | end 44 | add_message "POGOProtos.Data.Player.ContactSettings" do 45 | optional :send_marketing_emails, :bool, 1 46 | optional :send_push_notifications, :bool, 2 47 | end 48 | add_message "POGOProtos.Data.Player.PlayerCamera" do 49 | optional :is_default_camera, :bool, 1 50 | end 51 | add_message "POGOProtos.Data.Player.PlayerAvatar" do 52 | optional :skin, :int32, 2 53 | optional :hair, :int32, 3 54 | optional :shirt, :int32, 4 55 | optional :pants, :int32, 5 56 | optional :hat, :int32, 6 57 | optional :shoes, :int32, 7 58 | optional :gender, :enum, 8, "POGOProtos.Enums.Gender" 59 | optional :eyes, :int32, 9 60 | optional :backpack, :int32, 10 61 | end 62 | add_message "POGOProtos.Data.Player.EquippedBadge" do 63 | optional :badge_type, :enum, 1, "POGOProtos.Enums.BadgeType" 64 | optional :level, :int32, 2 65 | optional :next_equip_change_allowed_timestamp_ms, :int64, 3 66 | end 67 | add_message "POGOProtos.Data.Player.PlayerPublicProfile" do 68 | optional :name, :string, 1 69 | optional :level, :int32, 2 70 | optional :avatar, :message, 3, "POGOProtos.Data.Player.PlayerAvatar" 71 | end 72 | end 73 | 74 | module POGOProtos 75 | module Data 76 | module Player 77 | Currency = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Player.Currency").msgclass 78 | PlayerCurrency = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Player.PlayerCurrency").msgclass 79 | DailyBonus = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Player.DailyBonus").msgclass 80 | PlayerStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Player.PlayerStats").msgclass 81 | ContactSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Player.ContactSettings").msgclass 82 | PlayerCamera = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Player.PlayerCamera").msgclass 83 | PlayerAvatar = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Player.PlayerAvatar").msgclass 84 | EquippedBadge = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Player.EquippedBadge").msgclass 85 | PlayerPublicProfile = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Player.PlayerPublicProfile").msgclass 86 | end 87 | end 88 | end 89 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_settings_master_item.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Settings.Master.Item.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_enums' 7 | require_relative 'pogoprotos_inventory' 8 | Google::Protobuf::DescriptorPool.generated_pool.build do 9 | add_message "POGOProtos.Settings.Master.Item.PokeballAttributes" do 10 | optional :item_effect, :enum, 1, "POGOProtos.Enums.ItemEffect" 11 | optional :capture_multi, :float, 2 12 | optional :capture_multi_effect, :float, 3 13 | optional :item_effect_mod, :float, 4 14 | end 15 | add_message "POGOProtos.Settings.Master.Item.IncenseAttributes" do 16 | optional :incense_lifetime_seconds, :int32, 1 17 | repeated :pokemon_type, :enum, 2, "POGOProtos.Enums.PokemonType" 18 | optional :pokemon_incense_type_probability, :float, 3 19 | optional :standing_time_between_encounters_seconds, :int32, 4 20 | optional :moving_time_between_encounter_seconds, :int32, 5 21 | optional :distance_required_for_shorter_interval_meters, :int32, 6 22 | optional :pokemon_attracted_length_sec, :int32, 7 23 | end 24 | add_message "POGOProtos.Settings.Master.Item.PotionAttributes" do 25 | optional :sta_percent, :float, 1 26 | optional :sta_amount, :int32, 2 27 | end 28 | add_message "POGOProtos.Settings.Master.Item.BattleAttributes" do 29 | optional :sta_percent, :float, 1 30 | end 31 | add_message "POGOProtos.Settings.Master.Item.ReviveAttributes" do 32 | optional :sta_percent, :float, 1 33 | end 34 | add_message "POGOProtos.Settings.Master.Item.InventoryUpgradeAttributes" do 35 | optional :additional_storage, :int32, 1 36 | optional :upgrade_type, :enum, 2, "POGOProtos.Inventory.InventoryUpgradeType" 37 | end 38 | add_message "POGOProtos.Settings.Master.Item.EggIncubatorAttributes" do 39 | optional :incubator_type, :enum, 1, "POGOProtos.Inventory.EggIncubatorType" 40 | optional :uses, :int32, 2 41 | optional :distance_multiplier, :float, 3 42 | end 43 | add_message "POGOProtos.Settings.Master.Item.FortModifierAttributes" do 44 | optional :modifier_lifetime_seconds, :int32, 1 45 | optional :troy_disk_num_pokemon_spawned, :int32, 2 46 | end 47 | add_message "POGOProtos.Settings.Master.Item.ExperienceBoostAttributes" do 48 | optional :xp_multiplier, :float, 1 49 | optional :boost_duration_ms, :int32, 2 50 | end 51 | add_message "POGOProtos.Settings.Master.Item.FoodAttributes" do 52 | repeated :item_effect, :enum, 1, "POGOProtos.Enums.ItemEffect" 53 | repeated :item_effect_percent, :float, 2 54 | optional :growth_percent, :float, 3 55 | end 56 | end 57 | 58 | module POGOProtos 59 | module Settings 60 | module Master 61 | module Item 62 | PokeballAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.PokeballAttributes").msgclass 63 | IncenseAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.IncenseAttributes").msgclass 64 | PotionAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.PotionAttributes").msgclass 65 | BattleAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.BattleAttributes").msgclass 66 | ReviveAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.ReviveAttributes").msgclass 67 | InventoryUpgradeAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.InventoryUpgradeAttributes").msgclass 68 | EggIncubatorAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.EggIncubatorAttributes").msgclass 69 | FortModifierAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.FortModifierAttributes").msgclass 70 | ExperienceBoostAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.ExperienceBoostAttributes").msgclass 71 | FoodAttributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.Item.FoodAttributes").msgclass 72 | end 73 | end 74 | end 75 | end 76 | -------------------------------------------------------------------------------- /lib/poke-api/geometry/s2_cell_id.rb: -------------------------------------------------------------------------------- 1 | module Poke 2 | module API 3 | module Geometry 4 | class S2CellId 5 | include S2Base 6 | attr_reader :id 7 | 8 | def initialize(id) 9 | @id = id 10 | end 11 | 12 | def parent(level) 13 | new_lsb = lsb_for_level(level) 14 | s2 = S2CellId.new((@id & -new_lsb) | new_lsb) 15 | 16 | raise Errors::InvalidLevel, level unless valid?(s2.id) 17 | s2 18 | end 19 | 20 | def prev 21 | S2CellId.new(@id - (lsb << 1)) 22 | end 23 | 24 | def next 25 | S2CellId.new(@id + (lsb << 1)) 26 | end 27 | 28 | def level 29 | return MAX_LEVEL if leaf? 30 | 31 | x = (@id & 0xffffffff) 32 | level = -1 33 | 34 | if x != 0 35 | level += 16 36 | else 37 | x = ((@id >> 32) & 0xffffffff) 38 | end 39 | 40 | x &= -x 41 | 42 | level += 8 unless (x & 0x00005555).zero? 43 | level += 4 unless (x & 0x00550055).zero? 44 | level += 2 unless (x & 0x05050505).zero? 45 | level += 1 unless (x & 0x11111111).zero? 46 | level 47 | end 48 | 49 | def self.from_point(p) 50 | face, u, v = xyz_to_face_uv(p) 51 | i = st_to_ij(uv_to_st(u)) 52 | j = st_to_ij(uv_to_st(v)) 53 | 54 | S2CellId.new(from_face_ij(face, i, j)) 55 | end 56 | 57 | def self.from_face_ij(face, i, j) 58 | n = face << (POS_BITS - 1) 59 | bits = face & SWAP_MASK 60 | 61 | 7.downto(0).each do |k| 62 | mask = (1 << LOOKUP_BITS) - 1 63 | bits += (((i >> (k * LOOKUP_BITS)) & mask) << (LOOKUP_BITS + 2)) 64 | bits += (((j >> (k * LOOKUP_BITS)) & mask) << 2) 65 | bits = LOOKUP_POS[bits] 66 | n |= (bits >> 2) << (k * 2 * LOOKUP_BITS) 67 | bits &= (SWAP_MASK | INVERT_MASK) 68 | end 69 | 70 | @id = (n * 2 + 1) 71 | end 72 | 73 | def self.xyz_to_face_uv(p) 74 | face = p.largest_abs_component 75 | 76 | pface = case face 77 | when 0 then p.x 78 | when 1 then p.y 79 | else p.z 80 | end 81 | 82 | face += 3 if pface < 0 83 | 84 | u, v = valid_face_xyz_to_uv(face, p) 85 | [face, u, v] 86 | end 87 | 88 | def self.uv_to_st(u) 89 | return 0.5 * Math.sqrt(1 + 3 * u) if u >= 0 90 | 1 - 0.5 * Math.sqrt(1 - 3 * u) 91 | end 92 | 93 | def self.st_to_ij(s) 94 | [0, [MAX_SIZE - 1, Integer((MAX_SIZE * s).floor)].min].max 95 | end 96 | 97 | def self.valid_face_xyz_to_uv(face, p) 98 | raise unless p.dot_prod(face_uv_to_xyz(face, 0, 0)) > 0 99 | 100 | case face 101 | when 0 then [p.y / p.x, p.z / p.x] 102 | when 1 then [-p.x / p.y, p.z / p.y] 103 | when 2 then [-p.x / p.z, -p.y / p.z] 104 | when 3 then [p.z / p.x, p.y / p.x] 105 | when 4 then [p.z / p.y, -p.x / p.y] 106 | else [-p.y / p.z, -p.x / p.z] 107 | end 108 | end 109 | 110 | def self.face_uv_to_xyz(face, u, v) 111 | case face 112 | when 0 then S2Point.new(1, u, v) 113 | when 1 then S2Point.new(-u, 1, v) 114 | when 2 then S2Point.new(-u, -v, 1) 115 | when 3 then S2Point.new(-1, -v, -u) 116 | when 4 then S2Point.new(v, -1, -u) 117 | else S2Point.new(v, u, -1) 118 | end 119 | end 120 | 121 | private_class_method :face_uv_to_xyz, :valid_face_xyz_to_uv, :uv_to_st, 122 | :st_to_ij, :xyz_to_face_uv, :from_face_ij 123 | 124 | private 125 | 126 | def leaf? 127 | @id & 1 != 0 128 | end 129 | 130 | def valid?(s2_id) 131 | face = s2_id >> POS_BITS 132 | lsb = s2_id & -s2_id 133 | (face < NUM_FACES) && (lsb & 0x1555555555555555) != 0 134 | end 135 | 136 | def lsb 137 | @id & -@id 138 | end 139 | 140 | def lsb_for_level(level) 141 | 1 << (2 * (MAX_LEVEL - level)) 142 | end 143 | end 144 | end 145 | end 146 | end 147 | -------------------------------------------------------------------------------- /lib/poke-api/request_builder.rb: -------------------------------------------------------------------------------- 1 | require 'securerandom' 2 | 3 | module Poke 4 | module API 5 | class RequestBuilder 6 | include Logging 7 | attr_reader :position, :start_time 8 | 9 | def initialize(auth, pos, endpoint, http_client) 10 | @access_token = auth.access_token 11 | @provider = auth.provider 12 | @endpoint = endpoint 13 | @position = pos 14 | @client = http_client ? http_client : HTTPClient.new 15 | @start_time = Helpers.fetch_time 16 | end 17 | 18 | def request(reqs, client) 19 | logger.debug '[+] Creating new request' 20 | request_proto = build_main_request(reqs, client) 21 | 22 | logger.debug "[+] Generated RPC protobuf encoded request \r\n#{request_proto.inspect}" 23 | logger.info '[+] Executing RPC request' 24 | 25 | resp = execute_rpc_request(request_proto) 26 | resp = Response.new(resp.body, reqs) 27 | 28 | resp.decode(client) 29 | resp 30 | end 31 | 32 | private 33 | 34 | def build_main_request(sub_reqs, client) 35 | request_envelope = POGOProtos::Networking::Envelopes::RequestEnvelope 36 | req = request_envelope.new( 37 | status_code: 2, 38 | request_id: 814_580_613_288_820_746_0, 39 | unknown12: 989 40 | ) 41 | req.latitude, req.longitude, req.altitude = @position 42 | 43 | build_sub_request(req, sub_reqs) 44 | set_authentication(req, client, request_envelope) 45 | 46 | logger.debug "[+] Generated RPC protobuf request \r\n#{req.inspect}" 47 | req.to_proto 48 | end 49 | 50 | def set_authentication(req, client, request_envelope) 51 | if client.ticket.get_ticket 52 | use_auth_ticket(req, client) 53 | else 54 | logger.info '[+] Using provider access token' 55 | token = request_envelope::AuthInfo::JWT.new(contents: @access_token, unknown2: 59) 56 | req.auth_info = request_envelope::AuthInfo.new(provider: @provider, token: token) 57 | end 58 | end 59 | 60 | def use_auth_ticket(req, client) 61 | req.auth_ticket = POGOProtos::Networking::Envelopes::AuthTicket.new( 62 | start: client.ticket.start, end: client.ticket.ends, 63 | expire_timestamp_ms: client.ticket.expire 64 | ) 65 | 66 | Signature.load_signature(client) if client.sig_path 67 | Signature.create_signature(req, self, client) if client.sig_loaded 68 | end 69 | 70 | def build_sub_request(req, sub_reqs) 71 | sub_reqs.each do |sub_req| 72 | if sub_req.is_a?(Symbol) 73 | append_int_request(req, sub_req) 74 | elsif sub_req.is_a?(Hash) 75 | append_hash_request(req, sub_req) 76 | end 77 | end 78 | end 79 | 80 | def append_int_request(req, sub_req) 81 | entry_id = fetch_request_id(sub_req) 82 | int_req = POGOProtos::Networking::Requests::Request.new(request_type: entry_id) 83 | 84 | req.requests << int_req 85 | logger.info "[+] Adding '#{int_req.request_type}' to RPC request" 86 | end 87 | 88 | def append_hash_request(req, sub_req) 89 | entry_name = sub_req.keys.first 90 | entry_id = fetch_request_id(entry_name) 91 | 92 | logger.info "[+] Adding '#{entry_name}' to RPC request with arguments" 93 | proto_class = fetch_proto_request_class(sub_req, entry_name) 94 | 95 | req.requests << POGOProtos::Networking::Requests::Request.new( 96 | request_type: entry_id, 97 | request_message: proto_class.to_proto 98 | ) 99 | end 100 | 101 | def fetch_request_id(name) 102 | POGOProtos::Networking::Requests::RequestType.const_get(name) 103 | end 104 | 105 | def fetch_proto_request_class(sub_req, entry_name) 106 | entry_content = sub_req[entry_name] 107 | proto_name = Poke::API::Helpers.camel_case_lower(entry_name) + 'Message' 108 | logger.debug "[+] #{entry_name}: #{entry_content}" 109 | 110 | POGOProtos::Networking::Requests::Messages.const_get(proto_name).new(entry_content) 111 | end 112 | 113 | def execute_rpc_request(request) 114 | resp = @client.post(@endpoint, request) 115 | raise Errors::ForbiddenAccess if resp.status == 403 116 | 117 | resp 118 | end 119 | end 120 | end 121 | end 122 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_data.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Data.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_enums' 7 | require_relative 'pogoprotos_inventory_item' 8 | require_relative 'pogoprotos_data_player' 9 | Google::Protobuf::DescriptorPool.generated_pool.build do 10 | add_message "POGOProtos.Data.PokemonData" do 11 | optional :id, :fixed64, 1 12 | optional :pokemon_id, :enum, 2, "POGOProtos.Enums.PokemonId" 13 | optional :cp, :int32, 3 14 | optional :stamina, :int32, 4 15 | optional :stamina_max, :int32, 5 16 | optional :move_1, :enum, 6, "POGOProtos.Enums.PokemonMove" 17 | optional :move_2, :enum, 7, "POGOProtos.Enums.PokemonMove" 18 | optional :deployed_fort_id, :string, 8 19 | optional :owner_name, :string, 9 20 | optional :is_egg, :bool, 10 21 | optional :egg_km_walked_target, :double, 11 22 | optional :egg_km_walked_start, :double, 12 23 | optional :origin, :int32, 14 24 | optional :height_m, :float, 15 25 | optional :weight_kg, :float, 16 26 | optional :individual_attack, :int32, 17 27 | optional :individual_defense, :int32, 18 28 | optional :individual_stamina, :int32, 19 29 | optional :cp_multiplier, :float, 20 30 | optional :pokeball, :enum, 21, "POGOProtos.Inventory.Item.ItemId" 31 | optional :captured_cell_id, :uint64, 22 32 | optional :battles_attacked, :int32, 23 33 | optional :battles_defended, :int32, 24 34 | optional :egg_incubator_id, :string, 25 35 | optional :creation_time_ms, :uint64, 26 36 | optional :num_upgrades, :int32, 27 37 | optional :additional_cp_multiplier, :float, 28 38 | optional :favorite, :int32, 29 39 | optional :nickname, :string, 30 40 | optional :from_fort, :int32, 31 41 | end 42 | add_message "POGOProtos.Data.PlayerData" do 43 | optional :creation_timestamp_ms, :int64, 1 44 | optional :username, :string, 2 45 | optional :team, :enum, 5, "POGOProtos.Enums.TeamColor" 46 | repeated :tutorial_state, :enum, 7, "POGOProtos.Enums.TutorialState" 47 | optional :avatar, :message, 8, "POGOProtos.Data.Player.PlayerAvatar" 48 | optional :max_pokemon_storage, :int32, 9 49 | optional :max_item_storage, :int32, 10 50 | optional :daily_bonus, :message, 11, "POGOProtos.Data.Player.DailyBonus" 51 | optional :equipped_badge, :message, 12, "POGOProtos.Data.Player.EquippedBadge" 52 | optional :contact_settings, :message, 13, "POGOProtos.Data.Player.ContactSettings" 53 | repeated :currencies, :message, 14, "POGOProtos.Data.Player.Currency" 54 | optional :remaining_codename_claims, :int32, 15 55 | end 56 | add_message "POGOProtos.Data.AssetDigestEntry" do 57 | optional :asset_id, :string, 1 58 | optional :bundle_name, :string, 2 59 | optional :version, :int64, 3 60 | optional :checksum, :fixed32, 4 61 | optional :size, :int32, 5 62 | optional :key, :bytes, 6 63 | end 64 | add_message "POGOProtos.Data.PokedexEntry" do 65 | optional :pokemon_id, :enum, 1, "POGOProtos.Enums.PokemonId" 66 | optional :times_encountered, :int32, 2 67 | optional :times_captured, :int32, 3 68 | optional :evolution_stone_pieces, :int32, 4 69 | optional :evolution_stones, :int32, 5 70 | end 71 | add_message "POGOProtos.Data.DownloadUrlEntry" do 72 | optional :asset_id, :string, 1 73 | optional :url, :string, 2 74 | optional :size, :int32, 3 75 | optional :checksum, :fixed32, 4 76 | end 77 | add_message "POGOProtos.Data.PlayerBadge" do 78 | optional :badge_type, :enum, 1, "POGOProtos.Enums.BadgeType" 79 | optional :rank, :int32, 2 80 | optional :start_value, :int32, 3 81 | optional :end_value, :int32, 4 82 | optional :current_value, :double, 5 83 | end 84 | end 85 | 86 | module POGOProtos 87 | module Data 88 | PokemonData = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.PokemonData").msgclass 89 | PlayerData = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.PlayerData").msgclass 90 | AssetDigestEntry = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.AssetDigestEntry").msgclass 91 | PokedexEntry = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.PokedexEntry").msgclass 92 | DownloadUrlEntry = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.DownloadUrlEntry").msgclass 93 | PlayerBadge = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.PlayerBadge").msgclass 94 | end 95 | end 96 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_data_battle.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Data.Battle.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_data' 7 | require_relative 'pogoprotos_data_player' 8 | require_relative 'pogoprotos_data_gym' 9 | Google::Protobuf::DescriptorPool.generated_pool.build do 10 | add_message "POGOProtos.Data.Battle.BattlePokemonInfo" do 11 | optional :pokemon_data, :message, 1, "POGOProtos.Data.PokemonData" 12 | optional :current_health, :int32, 2 13 | optional :current_energy, :int32, 3 14 | end 15 | add_message "POGOProtos.Data.Battle.BattleParticipant" do 16 | optional :active_pokemon, :message, 1, "POGOProtos.Data.Battle.BattlePokemonInfo" 17 | optional :trainer_public_profile, :message, 2, "POGOProtos.Data.Player.PlayerPublicProfile" 18 | repeated :reverse_pokemon, :message, 3, "POGOProtos.Data.Battle.BattlePokemonInfo" 19 | repeated :defeated_pokemon, :message, 4, "POGOProtos.Data.Battle.BattlePokemonInfo" 20 | end 21 | add_message "POGOProtos.Data.Battle.BattleResults" do 22 | optional :gym_state, :message, 1, "POGOProtos.Data.Gym.GymState" 23 | repeated :attackers, :message, 2, "POGOProtos.Data.Battle.BattleParticipant" 24 | repeated :player_experience_awarded, :int32, 3 25 | optional :next_defender_pokemon_id, :int64, 4 26 | optional :gym_points_delta, :int32, 5 27 | end 28 | add_message "POGOProtos.Data.Battle.BattleAction" do 29 | optional :Type, :enum, 1, "POGOProtos.Data.Battle.BattleActionType" 30 | optional :action_start_ms, :int64, 2 31 | optional :duration_ms, :int32, 3 32 | optional :energy_delta, :int32, 5 33 | optional :attacker_index, :int32, 6 34 | optional :target_index, :int32, 7 35 | optional :active_pokemon_id, :fixed64, 8 36 | optional :player_joined, :message, 9, "POGOProtos.Data.Battle.BattleParticipant" 37 | optional :battle_results, :message, 10, "POGOProtos.Data.Battle.BattleResults" 38 | optional :damage_windows_start_timestamp_mss, :int64, 11 39 | optional :damage_windows_end_timestamp_mss, :int64, 12 40 | optional :player_left, :message, 13, "POGOProtos.Data.Battle.BattleParticipant" 41 | optional :target_pokemon_id, :fixed64, 14 42 | end 43 | add_message "POGOProtos.Data.Battle.BattleLog" do 44 | optional :state, :enum, 1, "POGOProtos.Data.Battle.BattleState" 45 | optional :battle_type, :enum, 2, "POGOProtos.Data.Battle.BattleType" 46 | optional :server_ms, :int64, 3 47 | repeated :battle_actions, :message, 4, "POGOProtos.Data.Battle.BattleAction" 48 | optional :battle_start_timestamp_ms, :int64, 5 49 | optional :battle_end_timestamp_ms, :int64, 6 50 | end 51 | add_enum "POGOProtos.Data.Battle.BattleType" do 52 | value :BATTLE_TYPE_UNSET, 0 53 | value :BATTLE_TYPE_NORMAL, 1 54 | value :BATTLE_TYPE_TRAINING, 2 55 | end 56 | add_enum "POGOProtos.Data.Battle.BattleState" do 57 | value :STATE_UNSET, 0 58 | value :ACTIVE, 1 59 | value :VICTORY, 2 60 | value :DEFEATED, 3 61 | value :TIMED_OUT, 4 62 | end 63 | add_enum "POGOProtos.Data.Battle.BattleActionType" do 64 | value :ACTION_UNSET, 0 65 | value :ACTION_ATTACK, 1 66 | value :ACTION_DODGE, 2 67 | value :ACTION_SPECIAL_ATTACK, 3 68 | value :ACTION_SWAP_POKEMON, 4 69 | value :ACTION_FAINT, 5 70 | value :ACTION_PLAYER_JOIN, 6 71 | value :ACTION_PLAYER_QUIT, 7 72 | value :ACTION_VICTORY, 8 73 | value :ACTION_DEFEAT, 9 74 | value :ACTION_TIMED_OUT, 10 75 | end 76 | end 77 | 78 | module POGOProtos 79 | module Data 80 | module Battle 81 | BattlePokemonInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Battle.BattlePokemonInfo").msgclass 82 | BattleParticipant = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Battle.BattleParticipant").msgclass 83 | BattleResults = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Battle.BattleResults").msgclass 84 | BattleAction = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Battle.BattleAction").msgclass 85 | BattleLog = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Battle.BattleLog").msgclass 86 | BattleType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Battle.BattleType").enummodule 87 | BattleState = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Battle.BattleState").enummodule 88 | BattleActionType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Data.Battle.BattleActionType").enummodule 89 | end 90 | end 91 | end 92 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_inventory.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Inventory.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_inventory_item' 7 | require_relative 'pogoprotos_enums' 8 | require_relative 'pogoprotos_data' 9 | require_relative 'pogoprotos_data_player' 10 | Google::Protobuf::DescriptorPool.generated_pool.build do 11 | add_message "POGOProtos.Inventory.InventoryUpgrade" do 12 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 13 | optional :upgrade_type, :enum, 2, "POGOProtos.Inventory.InventoryUpgradeType" 14 | optional :additional_storage, :int32, 3 15 | end 16 | add_message "POGOProtos.Inventory.EggIncubator" do 17 | optional :id, :string, 1 18 | optional :item_id, :enum, 2, "POGOProtos.Inventory.Item.ItemId" 19 | optional :incubator_type, :enum, 3, "POGOProtos.Inventory.EggIncubatorType" 20 | optional :uses_remaining, :int32, 4 21 | optional :pokemon_id, :uint64, 5 22 | optional :start_km_walked, :double, 6 23 | optional :target_km_walked, :double, 7 24 | end 25 | add_message "POGOProtos.Inventory.EggIncubators" do 26 | repeated :egg_incubator, :message, 1, "POGOProtos.Inventory.EggIncubator" 27 | end 28 | add_message "POGOProtos.Inventory.AppliedItem" do 29 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 30 | optional :item_type, :enum, 2, "POGOProtos.Inventory.Item.ItemType" 31 | optional :expire_ms, :int64, 3 32 | optional :applied_ms, :int64, 4 33 | end 34 | add_message "POGOProtos.Inventory.InventoryItem" do 35 | optional :modified_timestamp_ms, :int64, 1 36 | optional :deleted_item, :message, 2, "POGOProtos.Inventory.InventoryItem.DeletedItem" 37 | optional :inventory_item_data, :message, 3, "POGOProtos.Inventory.InventoryItemData" 38 | end 39 | add_message "POGOProtos.Inventory.InventoryItem.DeletedItem" do 40 | optional :pokemon_id, :fixed64, 1 41 | end 42 | add_message "POGOProtos.Inventory.Candy" do 43 | optional :family_id, :enum, 1, "POGOProtos.Enums.PokemonFamilyId" 44 | optional :candy, :int32, 2 45 | end 46 | add_message "POGOProtos.Inventory.InventoryDelta" do 47 | optional :original_timestamp_ms, :int64, 1 48 | optional :new_timestamp_ms, :int64, 2 49 | repeated :inventory_items, :message, 3, "POGOProtos.Inventory.InventoryItem" 50 | end 51 | add_message "POGOProtos.Inventory.AppliedItems" do 52 | repeated :item, :message, 4, "POGOProtos.Inventory.AppliedItem" 53 | end 54 | add_message "POGOProtos.Inventory.InventoryItemData" do 55 | optional :pokemon_data, :message, 1, "POGOProtos.Data.PokemonData" 56 | optional :item, :message, 2, "POGOProtos.Inventory.Item.ItemData" 57 | optional :pokedex_entry, :message, 3, "POGOProtos.Data.PokedexEntry" 58 | optional :player_stats, :message, 4, "POGOProtos.Data.Player.PlayerStats" 59 | optional :player_currency, :message, 5, "POGOProtos.Data.Player.PlayerCurrency" 60 | optional :player_camera, :message, 6, "POGOProtos.Data.Player.PlayerCamera" 61 | optional :inventory_upgrades, :message, 7, "POGOProtos.Inventory.InventoryUpgrades" 62 | optional :applied_items, :message, 8, "POGOProtos.Inventory.AppliedItems" 63 | optional :egg_incubators, :message, 9, "POGOProtos.Inventory.EggIncubators" 64 | optional :candy, :message, 10, "POGOProtos.Inventory.Candy" 65 | end 66 | add_message "POGOProtos.Inventory.InventoryUpgrades" do 67 | repeated :inventory_upgrades, :message, 1, "POGOProtos.Inventory.InventoryUpgrade" 68 | end 69 | add_enum "POGOProtos.Inventory.EggIncubatorType" do 70 | value :INCUBATOR_UNSET, 0 71 | value :INCUBATOR_DISTANCE, 1 72 | end 73 | add_enum "POGOProtos.Inventory.InventoryUpgradeType" do 74 | value :UPGRADE_UNSET, 0 75 | value :INCREASE_ITEM_STORAGE, 1 76 | value :INCREASE_POKEMON_STORAGE, 2 77 | end 78 | end 79 | 80 | module POGOProtos 81 | module Inventory 82 | InventoryUpgrade = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.InventoryUpgrade").msgclass 83 | EggIncubator = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.EggIncubator").msgclass 84 | EggIncubators = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.EggIncubators").msgclass 85 | AppliedItem = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.AppliedItem").msgclass 86 | InventoryItem = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.InventoryItem").msgclass 87 | InventoryItem::DeletedItem = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.InventoryItem.DeletedItem").msgclass 88 | Candy = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.Candy").msgclass 89 | InventoryDelta = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.InventoryDelta").msgclass 90 | AppliedItems = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.AppliedItems").msgclass 91 | InventoryItemData = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.InventoryItemData").msgclass 92 | InventoryUpgrades = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.InventoryUpgrades").msgclass 93 | EggIncubatorType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.EggIncubatorType").enummodule 94 | InventoryUpgradeType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Inventory.InventoryUpgradeType").enummodule 95 | end 96 | end 97 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_networking_envelopes.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Networking.Envelopes.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_data_player' 7 | require_relative 'pogoprotos_inventory_item' 8 | require_relative 'pogoprotos_networking_requests' 9 | Google::Protobuf::DescriptorPool.generated_pool.build do 10 | add_message "POGOProtos.Networking.Envelopes.Signature" do 11 | optional :timestamp_since_start, :uint64, 2 12 | repeated :location_fix, :message, 4, "POGOProtos.Networking.Envelopes.Signature.LocationFix" 13 | optional :android_gps_info, :message, 5, "POGOProtos.Networking.Envelopes.Signature.AndroidGpsInfo" 14 | optional :sensor_info, :message, 7, "POGOProtos.Networking.Envelopes.Signature.SensorInfo" 15 | optional :device_info, :message, 8, "POGOProtos.Networking.Envelopes.Signature.DeviceInfo" 16 | optional :activity_status, :message, 9, "POGOProtos.Networking.Envelopes.Signature.ActivityStatus" 17 | optional :location_hash1, :uint64, 10 18 | optional :location_hash2, :uint64, 20 19 | optional :session_hash, :bytes, 22 20 | optional :timestamp, :uint64, 23 21 | repeated :request_hash, :uint64, 24 22 | optional :unknown25, :int64, 25 23 | end 24 | add_message "POGOProtos.Networking.Envelopes.Signature.LocationFix" do 25 | optional :provider, :string, 1 26 | optional :timestamp_snapshot, :uint64, 2 27 | optional :latitude, :float, 13 28 | optional :longitude, :float, 14 29 | optional :horizontal_accuracy, :float, 20 30 | optional :altitude, :float, 21 31 | optional :vertical_accuracy, :float, 22 32 | optional :provider_status, :uint64, 26 33 | optional :floor, :uint32, 27 34 | optional :location_type, :uint64, 28 35 | end 36 | add_message "POGOProtos.Networking.Envelopes.Signature.AndroidGpsInfo" do 37 | optional :time_to_fix, :uint64, 1 38 | repeated :satellites_prn, :int32, 2 39 | repeated :snr, :float, 3 40 | repeated :azimuth, :float, 4 41 | repeated :elevation, :float, 5 42 | repeated :has_almanac, :bool, 6 43 | repeated :has_ephemeris, :bool, 7 44 | repeated :used_in_fix, :bool, 8 45 | end 46 | add_message "POGOProtos.Networking.Envelopes.Signature.SensorInfo" do 47 | optional :timestamp_snapshot, :uint64, 1 48 | optional :magnetometer_x, :double, 3 49 | optional :magnetometer_y, :double, 4 50 | optional :magnetometer_z, :double, 5 51 | optional :angle_normalized_x, :double, 6 52 | optional :angle_normalized_y, :double, 7 53 | optional :angle_normalized_z, :double, 8 54 | optional :accel_raw_x, :double, 10 55 | optional :accel_raw_y, :double, 11 56 | optional :accel_raw_z, :double, 12 57 | optional :gyroscope_raw_x, :double, 13 58 | optional :gyroscope_raw_y, :double, 14 59 | optional :gyroscope_raw_z, :double, 15 60 | optional :accel_normalized_x, :double, 16 61 | optional :accel_normalized_y, :double, 17 62 | optional :accel_normalized_z, :double, 18 63 | optional :accelerometer_axes, :uint64, 19 64 | end 65 | add_message "POGOProtos.Networking.Envelopes.Signature.DeviceInfo" do 66 | optional :device_id, :string, 1 67 | optional :android_board_name, :string, 2 68 | optional :android_bootloader, :string, 3 69 | optional :device_brand, :string, 4 70 | optional :device_model, :string, 5 71 | optional :device_model_identifier, :string, 6 72 | optional :device_model_boot, :string, 7 73 | optional :hardware_manufacturer, :string, 8 74 | optional :hardware_model, :string, 9 75 | optional :firmware_brand, :string, 10 76 | optional :firmware_tags, :string, 12 77 | optional :firmware_type, :string, 13 78 | optional :firmware_fingerprint, :string, 14 79 | end 80 | add_message "POGOProtos.Networking.Envelopes.Signature.ActivityStatus" do 81 | optional :start_time_ms, :uint64, 1 82 | optional :unknown_status, :bool, 2 83 | optional :walking, :bool, 3 84 | optional :running, :bool, 4 85 | optional :stationary, :bool, 5 86 | optional :automotive, :bool, 6 87 | optional :tilting, :bool, 7 88 | optional :cycling, :bool, 8 89 | optional :status, :bytes, 9 90 | end 91 | add_message "POGOProtos.Networking.Envelopes.Unknown6" do 92 | optional :request_type, :int32, 1 93 | optional :unknown2, :message, 2, "POGOProtos.Networking.Envelopes.Unknown6.Unknown2" 94 | end 95 | add_message "POGOProtos.Networking.Envelopes.Unknown6.Unknown2" do 96 | optional :encrypted_signature, :bytes, 1 97 | end 98 | add_message "POGOProtos.Networking.Envelopes.AuthTicket" do 99 | optional :start, :bytes, 1 100 | optional :expire_timestamp_ms, :uint64, 2 101 | optional :end, :bytes, 3 102 | end 103 | add_message "POGOProtos.Networking.Envelopes.ResponseEnvelope" do 104 | optional :status_code, :int32, 1 105 | optional :request_id, :uint64, 2 106 | optional :api_url, :string, 3 107 | repeated :unknown6, :message, 6, "POGOProtos.Networking.Envelopes.Unknown6Response" 108 | optional :auth_ticket, :message, 7, "POGOProtos.Networking.Envelopes.AuthTicket" 109 | repeated :returns, :bytes, 100 110 | optional :error, :string, 101 111 | end 112 | add_message "POGOProtos.Networking.Envelopes.Unknown6Response" do 113 | optional :response_type, :int32, 1 114 | optional :unknown2, :message, 2, "POGOProtos.Networking.Envelopes.Unknown6Response.Unknown2" 115 | end 116 | add_message "POGOProtos.Networking.Envelopes.Unknown6Response.Unknown2" do 117 | optional :unknown1, :uint64, 1 118 | repeated :items, :message, 2, "POGOProtos.Networking.Envelopes.Unknown6Response.Unknown2.StoreItem" 119 | repeated :player_currencies, :message, 3, "POGOProtos.Data.Player.Currency" 120 | optional :unknown4, :string, 4 121 | end 122 | add_message "POGOProtos.Networking.Envelopes.Unknown6Response.Unknown2.StoreItem" do 123 | optional :item_id, :string, 1 124 | optional :is_iap, :bool, 2 125 | optional :currency_to_buy, :message, 3, "POGOProtos.Data.Player.Currency" 126 | optional :yields_currency, :message, 4, "POGOProtos.Data.Player.Currency" 127 | optional :yields_item, :message, 5, "POGOProtos.Inventory.Item.ItemData" 128 | repeated :tags, :message, 6, "POGOProtos.Networking.Envelopes.Unknown6Response.Unknown2.StoreItem.Tag" 129 | optional :unknown7, :int32, 7 130 | end 131 | add_message "POGOProtos.Networking.Envelopes.Unknown6Response.Unknown2.StoreItem.Tag" do 132 | optional :key, :string, 1 133 | optional :value, :string, 2 134 | end 135 | add_message "POGOProtos.Networking.Envelopes.RequestEnvelope" do 136 | optional :status_code, :int32, 1 137 | optional :request_id, :uint64, 3 138 | repeated :requests, :message, 4, "POGOProtos.Networking.Requests.Request" 139 | optional :unknown6, :message, 6, "POGOProtos.Networking.Envelopes.Unknown6" 140 | optional :latitude, :double, 7 141 | optional :longitude, :double, 8 142 | optional :altitude, :double, 9 143 | optional :auth_info, :message, 10, "POGOProtos.Networking.Envelopes.RequestEnvelope.AuthInfo" 144 | optional :auth_ticket, :message, 11, "POGOProtos.Networking.Envelopes.AuthTicket" 145 | optional :unknown12, :int64, 12 146 | end 147 | add_message "POGOProtos.Networking.Envelopes.RequestEnvelope.AuthInfo" do 148 | optional :provider, :string, 1 149 | optional :token, :message, 2, "POGOProtos.Networking.Envelopes.RequestEnvelope.AuthInfo.JWT" 150 | end 151 | add_message "POGOProtos.Networking.Envelopes.RequestEnvelope.AuthInfo.JWT" do 152 | optional :contents, :string, 1 153 | optional :unknown2, :int32, 2 154 | end 155 | end 156 | 157 | module POGOProtos 158 | module Networking 159 | module Envelopes 160 | Signature = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Signature").msgclass 161 | Signature::LocationFix = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Signature.LocationFix").msgclass 162 | Signature::AndroidGpsInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Signature.AndroidGpsInfo").msgclass 163 | Signature::SensorInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Signature.SensorInfo").msgclass 164 | Signature::DeviceInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Signature.DeviceInfo").msgclass 165 | Signature::ActivityStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Signature.ActivityStatus").msgclass 166 | Unknown6 = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Unknown6").msgclass 167 | Unknown6::Unknown2 = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Unknown6.Unknown2").msgclass 168 | AuthTicket = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.AuthTicket").msgclass 169 | ResponseEnvelope = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.ResponseEnvelope").msgclass 170 | Unknown6Response = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Unknown6Response").msgclass 171 | Unknown6Response::Unknown2 = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Unknown6Response.Unknown2").msgclass 172 | Unknown6Response::Unknown2::StoreItem = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Unknown6Response.Unknown2.StoreItem").msgclass 173 | Unknown6Response::Unknown2::StoreItem::Tag = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.Unknown6Response.Unknown2.StoreItem.Tag").msgclass 174 | RequestEnvelope = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.RequestEnvelope").msgclass 175 | RequestEnvelope::AuthInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.RequestEnvelope.AuthInfo").msgclass 176 | RequestEnvelope::AuthInfo::JWT = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Envelopes.RequestEnvelope.AuthInfo.JWT").msgclass 177 | end 178 | end 179 | end 180 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_settings_master.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Settings.Master.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_enums' 7 | require_relative 'pogoprotos_settings_master_pokemon' 8 | require_relative 'pogoprotos_inventory_item' 9 | require_relative 'pogoprotos_settings_master_item' 10 | Google::Protobuf::DescriptorPool.generated_pool.build do 11 | add_message "POGOProtos.Settings.Master.IapSettings" do 12 | optional :daily_bonus_coins, :int32, 1 13 | repeated :daily_defender_bonus_per_pokemon, :int32, 2 14 | optional :daily_defender_bonus_max_defenders, :int32, 3 15 | repeated :daily_defender_bonus_currency, :string, 4 16 | optional :min_time_between_claims_ms, :int64, 5 17 | optional :daily_bonus_enabled, :bool, 6 18 | optional :daily_defender_bonus_enabled, :bool, 7 19 | end 20 | add_message "POGOProtos.Settings.Master.EquippedBadgeSettings" do 21 | optional :equip_badge_cooldown_ms, :int64, 1 22 | repeated :catch_probability_bonus, :float, 2 23 | repeated :flee_probability_bonus, :float, 3 24 | end 25 | add_message "POGOProtos.Settings.Master.GymLevelSettings" do 26 | repeated :required_experience, :int32, 1 27 | repeated :leader_slots, :int32, 2 28 | repeated :trainer_slots, :int32, 3 29 | repeated :search_roll_bonus, :int32, 4 30 | end 31 | add_message "POGOProtos.Settings.Master.TypeEffectiveSettings" do 32 | repeated :attack_scalar, :float, 1 33 | optional :attack_type, :enum, 2, "POGOProtos.Enums.PokemonType" 34 | end 35 | add_message "POGOProtos.Settings.Master.PokemonSettings" do 36 | optional :pokemon_id, :enum, 1, "POGOProtos.Enums.PokemonId" 37 | optional :model_scale, :float, 3 38 | optional :type, :enum, 4, "POGOProtos.Enums.PokemonType" 39 | optional :type_2, :enum, 5, "POGOProtos.Enums.PokemonType" 40 | optional :camera, :message, 6, "POGOProtos.Settings.Master.Pokemon.CameraAttributes" 41 | optional :encounter, :message, 7, "POGOProtos.Settings.Master.Pokemon.EncounterAttributes" 42 | optional :stats, :message, 8, "POGOProtos.Settings.Master.Pokemon.StatsAttributes" 43 | repeated :quick_moves, :enum, 9, "POGOProtos.Enums.PokemonMove" 44 | repeated :cinematic_moves, :enum, 10, "POGOProtos.Enums.PokemonMove" 45 | repeated :animation_time, :float, 11 46 | repeated :evolution_ids, :enum, 12, "POGOProtos.Enums.PokemonId" 47 | optional :evolution_pips, :int32, 13 48 | optional :rarity, :enum, 14, "POGOProtos.Enums.PokemonRarity" 49 | optional :pokedex_height_m, :float, 15 50 | optional :pokedex_weight_kg, :float, 16 51 | optional :parent_pokemon_id, :enum, 17, "POGOProtos.Enums.PokemonId" 52 | optional :height_std_dev, :float, 18 53 | optional :weight_std_dev, :float, 19 54 | optional :km_distance_to_hatch, :float, 20 55 | optional :family_id, :enum, 21, "POGOProtos.Enums.PokemonFamilyId" 56 | optional :candy_to_evolve, :int32, 22 57 | end 58 | add_message "POGOProtos.Settings.Master.GymBattleSettings" do 59 | optional :energy_per_sec, :float, 1 60 | optional :dodge_energy_cost, :float, 2 61 | optional :retarget_seconds, :float, 3 62 | optional :enemy_attack_interval, :float, 4 63 | optional :attack_server_interval, :float, 5 64 | optional :round_duration_seconds, :float, 6 65 | optional :bonus_time_per_ally_seconds, :float, 7 66 | optional :maximum_attackers_per_battle, :int32, 8 67 | optional :same_type_attack_bonus_multiplier, :float, 9 68 | optional :maximum_energy, :int32, 10 69 | optional :energy_delta_per_health_lost, :float, 11 70 | optional :dodge_duration_ms, :int32, 12 71 | optional :minimum_player_level, :int32, 13 72 | optional :swap_duration_ms, :int32, 14 73 | optional :dodge_damage_reduction_percent, :float, 15 74 | end 75 | add_message "POGOProtos.Settings.Master.MoveSettings" do 76 | optional :movement_id, :enum, 1, "POGOProtos.Enums.PokemonMove" 77 | optional :animation_id, :int32, 2 78 | optional :pokemon_type, :enum, 3, "POGOProtos.Enums.PokemonType" 79 | optional :power, :float, 4 80 | optional :accuracy_chance, :float, 5 81 | optional :critical_chance, :float, 6 82 | optional :heal_scalar, :float, 7 83 | optional :stamina_loss_scalar, :float, 8 84 | optional :trainer_level_min, :int32, 9 85 | optional :trainer_level_max, :int32, 10 86 | optional :vfx_name, :string, 11 87 | optional :duration_ms, :int32, 12 88 | optional :damage_window_start_ms, :int32, 13 89 | optional :damage_window_end_ms, :int32, 14 90 | optional :energy_delta, :int32, 15 91 | end 92 | add_message "POGOProtos.Settings.Master.PokemonUpgradeSettings" do 93 | optional :upgrades_per_level, :int32, 1 94 | optional :allowed_levels_above_player, :int32, 2 95 | repeated :candy_cost, :int32, 3 96 | repeated :stardust_cost, :int32, 4 97 | end 98 | add_message "POGOProtos.Settings.Master.BadgeSettings" do 99 | optional :badge_type, :enum, 1, "POGOProtos.Enums.BadgeType" 100 | optional :badge_rank, :int32, 2 101 | repeated :targets, :int32, 3 102 | end 103 | add_message "POGOProtos.Settings.Master.PlayerLevelSettings" do 104 | repeated :rank_num, :int32, 1 105 | repeated :required_experience, :int32, 2 106 | repeated :cp_multiplier, :float, 3 107 | optional :max_egg_player_level, :int32, 4 108 | optional :max_encounter_player_level, :int32, 5 109 | end 110 | add_message "POGOProtos.Settings.Master.MoveSequenceSettings" do 111 | repeated :sequence, :string, 1 112 | end 113 | add_message "POGOProtos.Settings.Master.IapItemDisplay" do 114 | optional :sku, :string, 1 115 | optional :category, :enum, 2, "POGOProtos.Enums.HoloIapItemCategory" 116 | optional :sort_order, :int32, 3 117 | repeated :item_ids, :enum, 4, "POGOProtos.Inventory.Item.ItemId" 118 | repeated :counts, :int32, 5 119 | end 120 | add_message "POGOProtos.Settings.Master.CameraSettings" do 121 | optional :next_camera, :string, 1 122 | repeated :interpolation, :enum, 2, "POGOProtos.Enums.CameraInterpolation" 123 | repeated :target_type, :enum, 3, "POGOProtos.Enums.CameraTarget" 124 | repeated :ease_in_speed, :float, 4 125 | repeated :east_out_speed, :float, 5 126 | repeated :duration_seconds, :float, 6 127 | repeated :wait_seconds, :float, 7 128 | repeated :transition_seconds, :float, 8 129 | repeated :angle_degree, :float, 9 130 | repeated :angle_offset_degree, :float, 10 131 | repeated :pitch_degree, :float, 11 132 | repeated :pitch_offset_degree, :float, 12 133 | repeated :roll_degree, :float, 13 134 | repeated :distance_meters, :float, 14 135 | repeated :height_percent, :float, 15 136 | repeated :vert_ctr_ratio, :float, 16 137 | end 138 | add_message "POGOProtos.Settings.Master.EncounterSettings" do 139 | optional :spin_bonus_threshold, :float, 1 140 | optional :excellent_throw_threshold, :float, 2 141 | optional :great_throw_threshold, :float, 3 142 | optional :nice_throw_threshold, :float, 4 143 | optional :milestone_threshold, :int32, 5 144 | end 145 | add_message "POGOProtos.Settings.Master.ItemSettings" do 146 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 147 | optional :item_type, :enum, 2, "POGOProtos.Inventory.Item.ItemType" 148 | optional :category, :enum, 3, "POGOProtos.Enums.ItemCategory" 149 | optional :drop_freq, :float, 4 150 | optional :drop_trainer_level, :int32, 5 151 | optional :pokeball, :message, 6, "POGOProtos.Settings.Master.Item.PokeballAttributes" 152 | optional :potion, :message, 7, "POGOProtos.Settings.Master.Item.PotionAttributes" 153 | optional :revive, :message, 8, "POGOProtos.Settings.Master.Item.ReviveAttributes" 154 | optional :battle, :message, 9, "POGOProtos.Settings.Master.Item.BattleAttributes" 155 | optional :food, :message, 10, "POGOProtos.Settings.Master.Item.FoodAttributes" 156 | optional :inventory_upgrade, :message, 11, "POGOProtos.Settings.Master.Item.InventoryUpgradeAttributes" 157 | optional :xp_boost, :message, 12, "POGOProtos.Settings.Master.Item.ExperienceBoostAttributes" 158 | optional :incense, :message, 13, "POGOProtos.Settings.Master.Item.IncenseAttributes" 159 | optional :egg_incubator, :message, 14, "POGOProtos.Settings.Master.Item.EggIncubatorAttributes" 160 | optional :fort_modifier, :message, 15, "POGOProtos.Settings.Master.Item.FortModifierAttributes" 161 | end 162 | end 163 | 164 | module POGOProtos 165 | module Settings 166 | module Master 167 | IapSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.IapSettings").msgclass 168 | EquippedBadgeSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.EquippedBadgeSettings").msgclass 169 | GymLevelSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.GymLevelSettings").msgclass 170 | TypeEffectiveSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.TypeEffectiveSettings").msgclass 171 | PokemonSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.PokemonSettings").msgclass 172 | GymBattleSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.GymBattleSettings").msgclass 173 | MoveSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.MoveSettings").msgclass 174 | PokemonUpgradeSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.PokemonUpgradeSettings").msgclass 175 | BadgeSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.BadgeSettings").msgclass 176 | PlayerLevelSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.PlayerLevelSettings").msgclass 177 | MoveSequenceSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.MoveSequenceSettings").msgclass 178 | IapItemDisplay = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.IapItemDisplay").msgclass 179 | CameraSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.CameraSettings").msgclass 180 | EncounterSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.EncounterSettings").msgclass 181 | ItemSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Settings.Master.ItemSettings").msgclass 182 | end 183 | end 184 | end 185 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Gem Version](https://badge.fury.io/rb/poke-go-api.svg)](https://badge.fury.io/rb/poke-go-api) [![Code Climate](https://codeclimate.com/github/nabeelamjad/poke-api/badges/gpa.svg)](https://codeclimate.com/github/nabeelamjad/poke-api) [![Issue Count](https://codeclimate.com/github/nabeelamjad/poke-api/badges/issue_count.svg)](https://codeclimate.com/github/nabeelamjad/poke-api) 2 | # Poke API - A Ruby API gem for Pokémon GO. 3 | Poke API is a port for Ruby from [pgoapi](https://github.com/tejado/pgoapi) and also allows for any automatic parsing of a requests and responses. 4 | 5 | * Unofficial, please use at your own RISK. 6 | * Use a throwaway account if possible. 7 | 8 | ## Features 9 | * Supports new SIGNATURE generation! 10 | * Allows you to set optional signature information for every request (``:android_gps_info``, ``:sensor_info``, ``:device_info``,``:activity_status`` and ``:location_fix``) 11 | * Proxy support! 12 | * Automatic access token/ticket refresh upon expiry! 13 | * S2 Geometry cells are now supported (natively)! 14 | * PTC & Google Authentication supported (use full e-mail address for Google) 15 | * Google refresh token support 16 | * Parses geolocation using Geocoder (parses addresses, postcodes, ip addresses, lat/long, etc) 17 | * Ability to chain requests and receive response in a single call 18 | * Logger available, you can also specify your own log formatter and/or log level 19 | * Lots of RPC calls, they are listed under [`lib/poke-api/pogoprotos/pogoprotos_networking_requests.rb`](lib/poke-api/pogoprotos/pogoprotos_networking_requests.rb) 20 | 21 | ## Installation 22 | You can use bundler and refer directly to this repository 23 | ``` 24 | gem 'poke-go-api', 25 | git: "https://github.com/nabeelamjad/poke-api.git", 26 | tag: '0.2.1' 27 | ``` 28 | 29 | Or, alternatively you can download the repository and run ``gem build poke-api.gemspec`` followed with ``gem install poke-api-0.2.1.gem`` 30 | 31 | The gem is also available by using ``gem install poke-go-api`` (poke-api was taken as a name already). 32 | 33 | **NOTE** - This gem relies on header files for Ruby to install the ``google-protobuf`` gem. 34 | * Windows: You will need the Ruby DevKit applied to your Ruby, please see [RubyInstaller](http://rubyinstaller.org/downloads/) 35 | * Linux: 36 | * Debian based: ``sudo apt-get install ruby-dev`` 37 | * RPM based: ``sudo yum install ruby-devel`` 38 | * SuSe based: ``sudo zypper install ruby-devel`` 39 | 40 | ## Example Usage 41 | Running provided ``example.rb`` with your own credentials 42 | ```ruby 43 | 2016-08-09T02:54:03+01:00]: INFO > Poke::API::Client --: [+] Given location: New York, NY, USA 44 | 2016-08-09T02:54:03+01:00]: INFO > Poke::API::Client --: [+] Lat/Long: 40.7127837, -74.0059413 45 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Client --: [+] Provider access token is valid for 03:00:00 46 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::RequestBuilder --: [+] Adding 'GET_HATCHED_EGGS' to RPC request 47 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::RequestBuilder --: [+] Using provider access token 48 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::RequestBuilder --: [+] Executing RPC request 49 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Response --: [+] Decoding Main RPC responses 50 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Response --: [+] Using auth ticket instead 51 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Response --: [+] Decoding Sub RPC responses 52 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Client --: [+] Cleaning up RPC requests 53 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Client --: [+] Login with PTC Successful 54 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Client --: [+] File <> has been set for signature generation 55 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::RequestBuilder --: [+] Adding 'GET_MAP_OBJECTS' to RPC request with ar ents 56 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::RequestBuilder --: [+] Adding 'GET_PLAYER' to RPC request 57 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::RequestBuilder --: [+] Adding 'GET_INVENTORY' to RPC request 58 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Auth::Ticket --: [+] Auth ticket is valid for 00:30:01 59 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Signature --: [+] Loaded Signature module 60 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::RequestBuilder --: [+] Executing RPC request 61 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Response --: [+] Decoding Main RPC responses 62 | 2016-08-09T02:54:06+01:00]: INFO > Poke::API::Response --: [+] Decoding Sub RPC responses 63 | 2016-08-09T02:54:07+01:00]: INFO > Poke::API::Client --: [+] Cleaning up RPC requests 64 | 67 | {:latitude=>40.7127837, 68 | :longitude=>-74.0059413, 69 | :since_timestamp_ms=> 70 | [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 71 | :cell_id=> 72 | [9926595610352287744, 73 | 9926595612499771392, 74 | 9926595614647255040, 75 | 9926595616794738688, 76 | 9926595618942222336, 77 | 9926595621089705984, 78 | 9926595623237189632, 79 | 9926595625384673280, 80 | 9926595627532156928, 81 | 9926595629679640576, 82 | 9926595631827124224, 83 | 9926595633974607872, 84 | 9926595636122091520, 85 | 9926595638269575168, 86 | 9926595640417058816, 87 | 9926595642564542464, 88 | 9926595644712026112, 89 | 9926595646859509760, 90 | 9926595649006993408, 91 | 9926595651154477056, 92 | 9926595653301960704]}}, 93 | :GET_PLAYER, 94 | :GET_INVENTORY], 95 | @response= 96 | {:GET_MAP_OBJECTS=> 97 | {:map_cells=> 98 | [{:s2_cell_id=>9926595631827124224, 99 | :current_timestamp_ms=>1470707648730, 100 | :forts=> 101 | [{:id=>"44a31b1c990547f49537ca74617bf557.12", 102 | :last_modified_timestamp_ms=>1470707647002, 103 | :latitude=>40.712891, 104 | :longitude=>-74.004869, 105 | :owned_by_team=>:BLUE, 106 | :guard_pokemon_id=>:GYARADOS, 107 | :guard_pokemon_cp=>0, 108 | :enabled=>true, 109 | :type=>:GYM, 110 | :gym_points=>1604, 111 | :is_in_battle=>true, 112 | :active_fort_modifier=>"", 113 | :lure_info=>nil, 114 | :cooldown_complete_timestamp_ms=>0, 115 | :sponsor=>:UNSET_SPONSOR, 116 | :rendering_type=>:DEFAULT}, 117 | ... 118 | ``` 119 | 120 | # RPC call requests and responses 121 | An RPC request can be made on its own or with multiple calls, it also provides the ability to specify arguments. You can find all the supported requests in [`lib/poke-api/pogoprotos/pogoprotos_networking_requests.rb`](lib/poke-api/pogoprotos/pogoprotos_networking_requests.rb). Please note that you will need to check if any of these requests require arguments, these can be found in [`lib/poke-api/pogoprotos/pogoprotos_networking_requests_messages.rb`](lib/poke-api/pogoprotos/pogoprotos_networking_requests_messages.rb) using the same naming convention. 122 | 123 | **Let's assume we want to delete a few great balls from our inventory** 124 | If you open [**`Requests`**](lib/poke-api/pogoprotos/pogoprotos_networking_requests.rb) we can see that there's an entry for `:RECYCLE_INVENTORY_ITEM`. We now know that our call is ``recycle_inventory_item``, next we have to find out if there're any arguments to this call. We can find any possible arguments inside [**`Messages`**](lib/poke-api/pogoprotos/pogoprotos_networking_requests_messages.rb) for our call. This shows two argments: ``item_id`` and ``count``. Furthermore we can see that ``item_id`` directly links to [**`POGOProtos.Inventory.Item.ItemId`**](lib/poke-api/pogoprotos/pogoprotos_inventory_item.rb), this is a file you can open as well with the item ids specified inside. In here we can see the Item ID for a great ball is 2. 125 | 126 | Our example request could be as follows: 127 | ```ruby 128 | require 'poke-api' 129 | 130 | # Instantiate our client 131 | client = Poke::API::Client.new 132 | 133 | # Both PTC/Google available as authentication provider 134 | client.store_location('New York') 135 | client.login('username@gmail.com', 'password', 'google') 136 | 137 | # Activate the encryption method to generate a signature (only required for map objects) 138 | client.activate_signature('/path/to/encrypt/file') 139 | 140 | # Add RPC calls 141 | client.recycle_inventory_item(item_id: 2, count: 2) 142 | 143 | # You can inspect the client before performing the call 144 | puts client.inspect 145 | => # @reqs=[{:RECYCLE_INVENTORY_ITEM=>{:item_id=>2, :count=>2}}] @lat=4630926632231391130 @lng=13858280158942612615 @alt=0> 146 | 147 | # Perform your RPC call 148 | call = client.call 149 | 150 | # A object is returned and decorated with your request and response in a Hash format 151 | # Request 152 | puts call.request.inspect 153 | [ 154 | { 155 | :RECYCLE_INVENTORY_ITEM => { 156 | :item_id=>2, 157 | :count=>2 158 | } 159 | } 160 | ] 161 | 162 | # Response 163 | puts call.response.inspect 164 | { 165 | :RECYCLE_INVENTORY_ITEM = >{ 166 | :result=>:SUCCESS, 167 | :new_count=>14 168 | }, 169 | :status_code => 1, 170 | :api_url => "", 171 | :error => "" 172 | } 173 | ``` 174 | # Optional Signature Information 175 | You can specify ``:android_gps_info``, ``:sensor_info``, ``:device_info``,``:activity_status`` and ``:location_fix`` for every request that is made. Here's an example how this is possible: 176 | 177 | ```ruby 178 | require 'poke-api' 179 | 180 | client = Poke::API::Client.new 181 | client.activate_signature('/path/to/encrypt/file') 182 | client.store_location('New York') 183 | client.login('username', 'password', 'ptc') 184 | 185 | # Set your optional requests here 186 | client.location_fix = {provider: 'foo'} 187 | client.android_gps_info = {satellites_prn: [1]} 188 | client.sensor_info = {magnetometer_x: 1.2} 189 | client.device_info = {device_model: 'some-device'} 190 | client.activity_status = {cycling: false} 191 | 192 | cell_ids = Poke::API::Helpers.get_cells(client.lat, client.lng) 193 | 194 | client.get_map_objects( 195 | latitude: client.lat, 196 | longitude: client.lng, 197 | since_timestamp_ms: [0] * cell_ids.length, 198 | cell_id: cell_ids 199 | ) 200 | 201 | client.call 202 | ``` 203 | Please refer to [**`networking_envelopes`**](lib/poke-api/pogoprotos/pogoprotos_networking_envelopes.rb) for more information as to which arguments are supported. 204 | # Google Refresh Token 205 | A Google refresh token can be set on ``Poke::API::Client``, this token will automatically be used first to generate an access token if available. You do not need to pass in any username or password if you provide a refresh token. To support backwards compatibility you will still have to call ``client.login('', '', 'google')``, however, you can leave the username and password as blank strings instead. 206 | 207 | ```ruby 208 | require 'poke-api' 209 | 210 | client = Poke::API::Client.new 211 | client.refresh_token = 'my-refresh-token' 212 | client.login('', '', 'google') 213 | ``` 214 | 215 | In a future revamp release the ``login`` method will change to accept keyword arguments such as ``client.login(provider: 'google')`` allowing you to ignore the rest. 216 | 217 | To generate a Google refresh token please have a look at [**this issue**](https://github.com/nabeelamjad/poke-api/issues/26#issuecomment-237404470), a refresh token will last indefinitely. 218 | 219 | # Proxy support 220 | If you wish to use a proxy then you can do so by providing your own ``HTTPClient`` instantation with your preferred setup to ``Poke::API::Client`` using ``http_client`` setter/getter. 221 | 222 | ```ruby 223 | require 'poke-api' 224 | 225 | client = Poke::API::Client.new 226 | client.http_client = HTTPClient.new('http://localhost:8080') 227 | client.http_client.set_proxy_auth(user, password) 228 | ... 229 | # Proceed as normal 230 | ``` 231 | 232 | # Logger settings 233 | If you wish to change the log level you can do so before instantiating the client by using ``Poke::API::Logging.log_level = :INFO`` where ``:INFO`` is the desired level, possible values are: ``:DEBUG``, ``:INFO``, ``:WARN``, ``:FATAL`` and ``UNKNOWN`` 234 | 235 | The log formatter format can also be customised, a default one is provided. You can provide a ``proc`` to ``Poke::API::Logging.formatter`` to change it. More information can be found at [`Class#Logger`](http://ruby-doc.org/stdlib-2.3.1/libdoc/logger/rdoc/Logger.html) 236 | 237 | Example: 238 | ```ruby 239 | require 'poke-api' 240 | 241 | # Use :DEBUG for extra verbosity if required to troubleshoot 242 | Poke::API::Logging.log_level = :DEBUG 243 | Poke::API::Logging.formatter = proc do |severity, datetime, progname, msg| 244 | "My custom logger - #{msg}\n" 245 | end 246 | 247 | client = Poke::API::Client.new 248 | client.store_location('London') 249 | #=> My custom logger - [+] Given location: London, UK 250 | #=> My custom logger - [+] Lat/Long: 51.5073509, -0.1277583 251 | ``` 252 | 253 | # Generating S2 Cell Ids 254 | You can use this helper method to generate cells, please note that not all S2 Geometry calls are supported as this has been ported over to native Ruby (without binding). Available instance methods on a **``S2CellId``** are ``parent``, ``level``, ``next`` and ``prev``. 255 | 256 | #### Example Usage 257 | ```ruby 258 | require 'poke-api' 259 | 260 | client = Poke::API::Client.new 261 | client.store_location('New York') 262 | 263 | [2016-08-09T02:52:10+01:00]: INFO > Poke::API::Client --: [+] Given location: New York, NY, USA 264 | [2016-08-09T02:52:10+01:00]: INFO > Poke::API::Client --: [+] Lat/Long: 40.7127837, -74.0059413 265 | 266 | Poke::API::Helpers.get_cells(client.lat, client.lng) 267 | => [9926595610352287744, 9926595612499771392, 9926595614647255040, 268 | 9926595616794738688, 9926595618942222336, 9926595621089705984, 269 | 9926595623237189632, 9926595625384673280, 9926595627532156928, 270 | 9926595629679640576, 9926595631827124224, 9926595633974607872, 271 | 9926595636122091520, 9926595638269575168, 9926595640417058816, 272 | 9926595642564542464, 9926595644712026112, 9926595646859509760, 273 | 9926595649006993408, 9926595651154477056, 9926595653301960704] 274 | ``` 275 | 276 | # Contribution 277 | Any contributions are most welcome, I don't have much time to spend on this project so I appreciate everything. 278 | 279 | # Credits 280 | [tejado](https://github.com/tejado/pgoapi) - Pretty much everything as this repository is a direct 'conversion' to the best of my ability 281 | [AeonLucid](https://github.com/AeonLucid/POGOProtos) - Protobufs 282 | [xssc](https://github.com/xssc/gpsoauth) - GPSOauth (Google Login) 283 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_networking_requests_messages.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Networking.Requests.Messages.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_enums' 7 | require_relative 'pogoprotos_inventory_item' 8 | require_relative 'pogoprotos_data_player' 9 | require_relative 'pogoprotos_data_battle' 10 | Google::Protobuf::DescriptorPool.generated_pool.build do 11 | add_message "POGOProtos.Networking.Requests.Messages.UpgradePokemonMessage" do 12 | optional :pokemon_id, :fixed64, 1 13 | end 14 | add_message "POGOProtos.Networking.Requests.Messages.GetAssetDigestMessage" do 15 | optional :platform, :enum, 1, "POGOProtos.Enums.Platform" 16 | optional :device_manufacturer, :string, 2 17 | optional :device_model, :string, 3 18 | optional :locale, :string, 4 19 | optional :app_version, :uint32, 5 20 | end 21 | add_message "POGOProtos.Networking.Requests.Messages.IncenseEncounterMessage" do 22 | optional :encounter_id, :uint64, 1 23 | optional :encounter_location, :string, 2 24 | end 25 | add_message "POGOProtos.Networking.Requests.Messages.StartGymBattleMessage" do 26 | optional :gym_id, :string, 1 27 | repeated :attacking_pokemon_ids, :fixed64, 2 28 | optional :defending_pokemon_id, :fixed64, 3 29 | optional :player_latitude, :double, 4 30 | optional :player_longitude, :double, 5 31 | end 32 | add_message "POGOProtos.Networking.Requests.Messages.UseIncenseMessage" do 33 | optional :incense_type, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 34 | end 35 | add_message "POGOProtos.Networking.Requests.Messages.CollectDailyDefenderBonusMessage" do 36 | end 37 | add_message "POGOProtos.Networking.Requests.Messages.GetInventoryMessage" do 38 | optional :last_timestamp_ms, :int64, 1 39 | optional :item_been_seen, :int32, 2 40 | end 41 | add_message "POGOProtos.Networking.Requests.Messages.SetContactSettingsMessage" do 42 | optional :contact_settings, :message, 1, "POGOProtos.Data.Player.ContactSettings" 43 | end 44 | add_message "POGOProtos.Networking.Requests.Messages.PlayerUpdateMessage" do 45 | optional :latitude, :double, 1 46 | optional :longitude, :double, 2 47 | end 48 | add_message "POGOProtos.Networking.Requests.Messages.FortDetailsMessage" do 49 | optional :fort_id, :string, 1 50 | optional :latitude, :double, 2 51 | optional :longitude, :double, 3 52 | end 53 | add_message "POGOProtos.Networking.Requests.Messages.GetHatchedEggsMessage" do 54 | end 55 | add_message "POGOProtos.Networking.Requests.Messages.EvolvePokemonMessage" do 56 | optional :pokemon_id, :fixed64, 1 57 | end 58 | add_message "POGOProtos.Networking.Requests.Messages.RecycleInventoryItemMessage" do 59 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 60 | optional :count, :int32, 2 61 | end 62 | add_message "POGOProtos.Networking.Requests.Messages.AttackGymMessage" do 63 | optional :gym_id, :string, 1 64 | optional :battle_id, :string, 2 65 | repeated :attack_actions, :message, 3, "POGOProtos.Data.Battle.BattleAction" 66 | optional :last_retrieved_actions, :message, 4, "POGOProtos.Data.Battle.BattleAction" 67 | optional :player_latitude, :double, 5 68 | optional :player_longitude, :double, 6 69 | end 70 | add_message "POGOProtos.Networking.Requests.Messages.ReleasePokemonMessage" do 71 | optional :pokemon_id, :fixed64, 1 72 | end 73 | add_message "POGOProtos.Networking.Requests.Messages.SetAvatarMessage" do 74 | optional :player_avatar, :message, 2, "POGOProtos.Data.Player.PlayerAvatar" 75 | end 76 | add_message "POGOProtos.Networking.Requests.Messages.DownloadItemTemplatesMessage" do 77 | end 78 | add_message "POGOProtos.Networking.Requests.Messages.GetMapObjectsMessage" do 79 | repeated :cell_id, :uint64, 1 80 | repeated :since_timestamp_ms, :int64, 2 81 | optional :latitude, :double, 3 82 | optional :longitude, :double, 4 83 | end 84 | add_message "POGOProtos.Networking.Requests.Messages.FortRecallPokemonMessage" do 85 | optional :fort_id, :string, 1 86 | optional :pokemon_id, :fixed64, 2 87 | optional :player_latitude, :double, 3 88 | optional :player_longitude, :double, 4 89 | end 90 | add_message "POGOProtos.Networking.Requests.Messages.GetGymDetailsMessage" do 91 | optional :gym_id, :string, 1 92 | optional :player_latitude, :double, 2 93 | optional :player_longitude, :double, 3 94 | optional :gym_latitude, :double, 4 95 | optional :gym_longitude, :double, 5 96 | optional :client_version, :string, 6 97 | end 98 | add_message "POGOProtos.Networking.Requests.Messages.SfidaActionLogMessage" do 99 | end 100 | add_message "POGOProtos.Networking.Requests.Messages.EchoMessage" do 101 | end 102 | add_message "POGOProtos.Networking.Requests.Messages.NicknamePokemonMessage" do 103 | optional :pokemon_id, :fixed64, 1 104 | optional :nickname, :string, 2 105 | end 106 | add_message "POGOProtos.Networking.Requests.Messages.CatchPokemonMessage" do 107 | optional :encounter_id, :fixed64, 1 108 | optional :pokeball, :enum, 2, "POGOProtos.Inventory.Item.ItemId" 109 | optional :normalized_reticle_size, :double, 3 110 | optional :spawn_point_id, :string, 4 111 | optional :hit_pokemon, :bool, 5 112 | optional :spin_modifier, :double, 6 113 | optional :normalized_hit_position, :double, 7 114 | end 115 | add_message "POGOProtos.Networking.Requests.Messages.FortSearchMessage" do 116 | optional :fort_id, :string, 1 117 | optional :player_latitude, :double, 2 118 | optional :player_longitude, :double, 3 119 | optional :fort_latitude, :double, 4 120 | optional :fort_longitude, :double, 5 121 | end 122 | add_message "POGOProtos.Networking.Requests.Messages.UseItemPotionMessage" do 123 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 124 | optional :pokemon_id, :fixed64, 2 125 | end 126 | add_message "POGOProtos.Networking.Requests.Messages.FortDeployPokemonMessage" do 127 | optional :fort_id, :string, 1 128 | optional :pokemon_id, :fixed64, 2 129 | optional :player_latitude, :double, 3 130 | optional :player_longitude, :double, 4 131 | end 132 | add_message "POGOProtos.Networking.Requests.Messages.EncounterMessage" do 133 | optional :encounter_id, :fixed64, 1 134 | optional :spawn_point_id, :string, 2 135 | optional :player_latitude, :double, 3 136 | optional :player_longitude, :double, 4 137 | end 138 | add_message "POGOProtos.Networking.Requests.Messages.GetPlayerProfileMessage" do 139 | optional :player_name, :string, 1 140 | end 141 | add_message "POGOProtos.Networking.Requests.Messages.GetSuggestedCodenamesMessage" do 142 | end 143 | add_message "POGOProtos.Networking.Requests.Messages.SetPlayerTeamMessage" do 144 | optional :team, :enum, 1, "POGOProtos.Enums.TeamColor" 145 | end 146 | add_message "POGOProtos.Networking.Requests.Messages.UseItemReviveMessage" do 147 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 148 | optional :pokemon_id, :fixed64, 2 149 | end 150 | add_message "POGOProtos.Networking.Requests.Messages.EquipBadgeMessage" do 151 | optional :badge_type, :enum, 1, "POGOProtos.Enums.BadgeType" 152 | end 153 | add_message "POGOProtos.Networking.Requests.Messages.SetFavoritePokemonMessage" do 154 | optional :pokemon_id, :int64, 1 155 | optional :is_favorite, :bool, 2 156 | end 157 | add_message "POGOProtos.Networking.Requests.Messages.CheckCodenameAvailableMessage" do 158 | optional :codename, :string, 1 159 | end 160 | add_message "POGOProtos.Networking.Requests.Messages.ClaimCodenameMessage" do 161 | optional :codename, :string, 1 162 | end 163 | add_message "POGOProtos.Networking.Requests.Messages.EncounterTutorialCompleteMessage" do 164 | optional :pokemon_id, :enum, 1, "POGOProtos.Enums.PokemonId" 165 | end 166 | add_message "POGOProtos.Networking.Requests.Messages.UseItemXpBoostMessage" do 167 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 168 | end 169 | add_message "POGOProtos.Networking.Requests.Messages.UseItemEggIncubatorMessage" do 170 | optional :item_id, :string, 1 171 | optional :pokemon_id, :uint64, 2 172 | end 173 | add_message "POGOProtos.Networking.Requests.Messages.GetDownloadUrlsMessage" do 174 | repeated :asset_id, :string, 1 175 | end 176 | add_message "POGOProtos.Networking.Requests.Messages.DiskEncounterMessage" do 177 | optional :encounter_id, :uint64, 1 178 | optional :fort_id, :string, 2 179 | optional :player_latitude, :double, 3 180 | optional :player_longitude, :double, 4 181 | end 182 | add_message "POGOProtos.Networking.Requests.Messages.CheckAwardedBadgesMessage" do 183 | end 184 | add_message "POGOProtos.Networking.Requests.Messages.UseItemGymMessage" do 185 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 186 | optional :gym_id, :string, 2 187 | optional :player_latitude, :double, 3 188 | optional :player_longitude, :double, 4 189 | end 190 | add_message "POGOProtos.Networking.Requests.Messages.GetIncensePokemonMessage" do 191 | optional :player_latitude, :double, 1 192 | optional :player_longitude, :double, 2 193 | end 194 | add_message "POGOProtos.Networking.Requests.Messages.UseItemCaptureMessage" do 195 | optional :item_id, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 196 | optional :encounter_id, :fixed64, 2 197 | optional :spawn_point_id, :string, 3 198 | end 199 | add_message "POGOProtos.Networking.Requests.Messages.CollectDailyBonusMessage" do 200 | end 201 | add_message "POGOProtos.Networking.Requests.Messages.DownloadSettingsMessage" do 202 | optional :hash, :string, 1 203 | end 204 | add_message "POGOProtos.Networking.Requests.Messages.GetPlayerMessage" do 205 | end 206 | add_message "POGOProtos.Networking.Requests.Messages.AddFortModifierMessage" do 207 | optional :modifier_type, :enum, 1, "POGOProtos.Inventory.Item.ItemId" 208 | optional :fort_id, :string, 2 209 | optional :player_latitude, :double, 3 210 | optional :player_longitude, :double, 4 211 | end 212 | add_message "POGOProtos.Networking.Requests.Messages.LevelUpRewardsMessage" do 213 | optional :level, :int32, 1 214 | end 215 | add_message "POGOProtos.Networking.Requests.Messages.DownloadRemoteConfigVersionMessage" do 216 | optional :platform, :enum, 1, "POGOProtos.Enums.Platform" 217 | optional :device_manufacturer, :string, 2 218 | optional :device_model, :string, 3 219 | optional :locale, :string, 4 220 | optional :app_version, :uint32, 5 221 | end 222 | add_message "POGOProtos.Networking.Requests.Messages.MarkTutorialCompleteMessage" do 223 | repeated :tutorials_completed, :enum, 1, "POGOProtos.Enums.TutorialState" 224 | optional :send_marketing_emails, :bool, 2 225 | optional :send_push_notifications, :bool, 3 226 | end 227 | end 228 | 229 | module POGOProtos 230 | module Networking 231 | module Requests 232 | module Messages 233 | UpgradePokemonMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.UpgradePokemonMessage").msgclass 234 | GetAssetDigestMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetAssetDigestMessage").msgclass 235 | IncenseEncounterMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.IncenseEncounterMessage").msgclass 236 | StartGymBattleMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.StartGymBattleMessage").msgclass 237 | UseIncenseMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.UseIncenseMessage").msgclass 238 | CollectDailyDefenderBonusMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.CollectDailyDefenderBonusMessage").msgclass 239 | GetInventoryMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetInventoryMessage").msgclass 240 | SetContactSettingsMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.SetContactSettingsMessage").msgclass 241 | PlayerUpdateMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.PlayerUpdateMessage").msgclass 242 | FortDetailsMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.FortDetailsMessage").msgclass 243 | GetHatchedEggsMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetHatchedEggsMessage").msgclass 244 | EvolvePokemonMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.EvolvePokemonMessage").msgclass 245 | RecycleInventoryItemMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.RecycleInventoryItemMessage").msgclass 246 | AttackGymMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.AttackGymMessage").msgclass 247 | ReleasePokemonMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.ReleasePokemonMessage").msgclass 248 | SetAvatarMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.SetAvatarMessage").msgclass 249 | DownloadItemTemplatesMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.DownloadItemTemplatesMessage").msgclass 250 | GetMapObjectsMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetMapObjectsMessage").msgclass 251 | FortRecallPokemonMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.FortRecallPokemonMessage").msgclass 252 | GetGymDetailsMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetGymDetailsMessage").msgclass 253 | SfidaActionLogMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.SfidaActionLogMessage").msgclass 254 | EchoMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.EchoMessage").msgclass 255 | NicknamePokemonMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.NicknamePokemonMessage").msgclass 256 | CatchPokemonMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.CatchPokemonMessage").msgclass 257 | FortSearchMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.FortSearchMessage").msgclass 258 | UseItemPotionMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.UseItemPotionMessage").msgclass 259 | FortDeployPokemonMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.FortDeployPokemonMessage").msgclass 260 | EncounterMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.EncounterMessage").msgclass 261 | GetPlayerProfileMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetPlayerProfileMessage").msgclass 262 | GetSuggestedCodenamesMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetSuggestedCodenamesMessage").msgclass 263 | SetPlayerTeamMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.SetPlayerTeamMessage").msgclass 264 | UseItemReviveMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.UseItemReviveMessage").msgclass 265 | EquipBadgeMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.EquipBadgeMessage").msgclass 266 | SetFavoritePokemonMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.SetFavoritePokemonMessage").msgclass 267 | CheckCodenameAvailableMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.CheckCodenameAvailableMessage").msgclass 268 | ClaimCodenameMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.ClaimCodenameMessage").msgclass 269 | EncounterTutorialCompleteMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.EncounterTutorialCompleteMessage").msgclass 270 | UseItemXpBoostMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.UseItemXpBoostMessage").msgclass 271 | UseItemEggIncubatorMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.UseItemEggIncubatorMessage").msgclass 272 | GetDownloadUrlsMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetDownloadUrlsMessage").msgclass 273 | DiskEncounterMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.DiskEncounterMessage").msgclass 274 | CheckAwardedBadgesMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.CheckAwardedBadgesMessage").msgclass 275 | UseItemGymMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.UseItemGymMessage").msgclass 276 | GetIncensePokemonMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetIncensePokemonMessage").msgclass 277 | UseItemCaptureMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.UseItemCaptureMessage").msgclass 278 | CollectDailyBonusMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.CollectDailyBonusMessage").msgclass 279 | DownloadSettingsMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.DownloadSettingsMessage").msgclass 280 | GetPlayerMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.GetPlayerMessage").msgclass 281 | AddFortModifierMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.AddFortModifierMessage").msgclass 282 | LevelUpRewardsMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.LevelUpRewardsMessage").msgclass 283 | DownloadRemoteConfigVersionMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.DownloadRemoteConfigVersionMessage").msgclass 284 | MarkTutorialCompleteMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Requests.Messages.MarkTutorialCompleteMessage").msgclass 285 | end 286 | end 287 | end 288 | end 289 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_enums.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Enums.proto 3 | 4 | require 'google/protobuf' 5 | 6 | Google::Protobuf::DescriptorPool.generated_pool.build do 7 | add_enum "POGOProtos.Enums.TutorialState" do 8 | value :LEGAL_SCREEN, 0 9 | value :AVATAR_SELECTION, 1 10 | value :ACCOUNT_CREATION, 2 11 | value :POKEMON_CAPTURE, 3 12 | value :NAME_SELECTION, 4 13 | value :POKEMON_BERRY, 5 14 | value :USE_ITEM, 6 15 | value :FIRST_TIME_EXPERIENCE_COMPLETE, 7 16 | value :POKESTOP_TUTORIAL, 8 17 | value :GYM_TUTORIAL, 9 18 | end 19 | add_enum "POGOProtos.Enums.PokemonMove" do 20 | value :MOVE_UNSET, 0 21 | value :THUNDER_SHOCK, 1 22 | value :QUICK_ATTACK, 2 23 | value :SCRATCH, 3 24 | value :EMBER, 4 25 | value :VINE_WHIP, 5 26 | value :TACKLE, 6 27 | value :RAZOR_LEAF, 7 28 | value :TAKE_DOWN, 8 29 | value :WATER_GUN, 9 30 | value :BITE, 10 31 | value :POUND, 11 32 | value :DOUBLE_SLAP, 12 33 | value :WRAP, 13 34 | value :HYPER_BEAM, 14 35 | value :LICK, 15 36 | value :DARK_PULSE, 16 37 | value :SMOG, 17 38 | value :SLUDGE, 18 39 | value :METAL_CLAW, 19 40 | value :VICE_GRIP, 20 41 | value :FLAME_WHEEL, 21 42 | value :MEGAHORN, 22 43 | value :WING_ATTACK, 23 44 | value :FLAMETHROWER, 24 45 | value :SUCKER_PUNCH, 25 46 | value :DIG, 26 47 | value :LOW_KICK, 27 48 | value :CROSS_CHOP, 28 49 | value :PSYCHO_CUT, 29 50 | value :PSYBEAM, 30 51 | value :EARTHQUAKE, 31 52 | value :STONE_EDGE, 32 53 | value :ICE_PUNCH, 33 54 | value :HEART_STAMP, 34 55 | value :DISCHARGE, 35 56 | value :FLASH_CANNON, 36 57 | value :PECK, 37 58 | value :DRILL_PECK, 38 59 | value :ICE_BEAM, 39 60 | value :BLIZZARD, 40 61 | value :AIR_SLASH, 41 62 | value :HEAT_WAVE, 42 63 | value :TWINEEDLE, 43 64 | value :POISON_JAB, 44 65 | value :AERIAL_ACE, 45 66 | value :DRILL_RUN, 46 67 | value :PETAL_BLIZZARD, 47 68 | value :MEGA_DRAIN, 48 69 | value :BUG_BUZZ, 49 70 | value :POISON_FANG, 50 71 | value :NIGHT_SLASH, 51 72 | value :SLASH, 52 73 | value :BUBBLE_BEAM, 53 74 | value :SUBMISSION, 54 75 | value :KARATE_CHOP, 55 76 | value :LOW_SWEEP, 56 77 | value :AQUA_JET, 57 78 | value :AQUA_TAIL, 58 79 | value :SEED_BOMB, 59 80 | value :PSYSHOCK, 60 81 | value :ROCK_THROW, 61 82 | value :ANCIENT_POWER, 62 83 | value :ROCK_TOMB, 63 84 | value :ROCK_SLIDE, 64 85 | value :POWER_GEM, 65 86 | value :SHADOW_SNEAK, 66 87 | value :SHADOW_PUNCH, 67 88 | value :SHADOW_CLAW, 68 89 | value :OMINOUS_WIND, 69 90 | value :SHADOW_BALL, 70 91 | value :BULLET_PUNCH, 71 92 | value :MAGNET_BOMB, 72 93 | value :STEEL_WING, 73 94 | value :IRON_HEAD, 74 95 | value :PARABOLIC_CHARGE, 75 96 | value :SPARK, 76 97 | value :THUNDER_PUNCH, 77 98 | value :THUNDER, 78 99 | value :THUNDERBOLT, 79 100 | value :TWISTER, 80 101 | value :DRAGON_BREATH, 81 102 | value :DRAGON_PULSE, 82 103 | value :DRAGON_CLAW, 83 104 | value :DISARMING_VOICE, 84 105 | value :DRAINING_KISS, 85 106 | value :DAZZLING_GLEAM, 86 107 | value :MOONBLAST, 87 108 | value :PLAY_ROUGH, 88 109 | value :CROSS_POISON, 89 110 | value :SLUDGE_BOMB, 90 111 | value :SLUDGE_WAVE, 91 112 | value :GUNK_SHOT, 92 113 | value :MUD_SHOT, 93 114 | value :BONE_CLUB, 94 115 | value :BULLDOZE, 95 116 | value :MUD_BOMB, 96 117 | value :FURY_CUTTER, 97 118 | value :BUG_BITE, 98 119 | value :SIGNAL_BEAM, 99 120 | value :X_SCISSOR, 100 121 | value :FLAME_CHARGE, 101 122 | value :FLAME_BURST, 102 123 | value :FIRE_BLAST, 103 124 | value :BRINE, 104 125 | value :WATER_PULSE, 105 126 | value :SCALD, 106 127 | value :HYDRO_PUMP, 107 128 | value :PSYCHIC, 108 129 | value :PSYSTRIKE, 109 130 | value :ICE_SHARD, 110 131 | value :ICY_WIND, 111 132 | value :FROST_BREATH, 112 133 | value :ABSORB, 113 134 | value :GIGA_DRAIN, 114 135 | value :FIRE_PUNCH, 115 136 | value :SOLAR_BEAM, 116 137 | value :LEAF_BLADE, 117 138 | value :POWER_WHIP, 118 139 | value :SPLASH, 119 140 | value :ACID, 120 141 | value :AIR_CUTTER, 121 142 | value :HURRICANE, 122 143 | value :BRICK_BREAK, 123 144 | value :CUT, 124 145 | value :SWIFT, 125 146 | value :HORN_ATTACK, 126 147 | value :STOMP, 127 148 | value :HEADBUTT, 128 149 | value :HYPER_FANG, 129 150 | value :SLAM, 130 151 | value :BODY_SLAM, 131 152 | value :REST, 132 153 | value :STRUGGLE, 133 154 | value :SCALD_BLASTOISE, 134 155 | value :HYDRO_PUMP_BLASTOISE, 135 156 | value :WRAP_GREEN, 136 157 | value :WRAP_PINK, 137 158 | value :FURY_CUTTER_FAST, 200 159 | value :BUG_BITE_FAST, 201 160 | value :BITE_FAST, 202 161 | value :SUCKER_PUNCH_FAST, 203 162 | value :DRAGON_BREATH_FAST, 204 163 | value :THUNDER_SHOCK_FAST, 205 164 | value :SPARK_FAST, 206 165 | value :LOW_KICK_FAST, 207 166 | value :KARATE_CHOP_FAST, 208 167 | value :EMBER_FAST, 209 168 | value :WING_ATTACK_FAST, 210 169 | value :PECK_FAST, 211 170 | value :LICK_FAST, 212 171 | value :SHADOW_CLAW_FAST, 213 172 | value :VINE_WHIP_FAST, 214 173 | value :RAZOR_LEAF_FAST, 215 174 | value :MUD_SHOT_FAST, 216 175 | value :ICE_SHARD_FAST, 217 176 | value :FROST_BREATH_FAST, 218 177 | value :QUICK_ATTACK_FAST, 219 178 | value :SCRATCH_FAST, 220 179 | value :TACKLE_FAST, 221 180 | value :POUND_FAST, 222 181 | value :CUT_FAST, 223 182 | value :POISON_JAB_FAST, 224 183 | value :ACID_FAST, 225 184 | value :PSYCHO_CUT_FAST, 226 185 | value :ROCK_THROW_FAST, 227 186 | value :METAL_CLAW_FAST, 228 187 | value :BULLET_PUNCH_FAST, 229 188 | value :WATER_GUN_FAST, 230 189 | value :SPLASH_FAST, 231 190 | value :WATER_GUN_FAST_BLASTOISE, 232 191 | value :MUD_SLAP_FAST, 233 192 | value :ZEN_HEADBUTT_FAST, 234 193 | value :CONFUSION_FAST, 235 194 | value :POISON_STING_FAST, 236 195 | value :BUBBLE_FAST, 237 196 | value :FEINT_ATTACK_FAST, 238 197 | value :STEEL_WING_FAST, 239 198 | value :FIRE_FANG_FAST, 240 199 | value :ROCK_SMASH_FAST, 241 200 | end 201 | add_enum "POGOProtos.Enums.ItemCategory" do 202 | value :ITEM_CATEGORY_NONE, 0 203 | value :ITEM_CATEGORY_POKEBALL, 1 204 | value :ITEM_CATEGORY_FOOD, 2 205 | value :ITEM_CATEGORY_MEDICINE, 3 206 | value :ITEM_CATEGORY_BOOST, 4 207 | value :ITEM_CATEGORY_UTILITES, 5 208 | value :ITEM_CATEGORY_CAMERA, 6 209 | value :ITEM_CATEGORY_DISK, 7 210 | value :ITEM_CATEGORY_INCUBATOR, 8 211 | value :ITEM_CATEGORY_INCENSE, 9 212 | value :ITEM_CATEGORY_XP_BOOST, 10 213 | value :ITEM_CATEGORY_INVENTORY_UPGRADE, 11 214 | end 215 | add_enum "POGOProtos.Enums.PokemonFamilyId" do 216 | value :FAMILY_UNSET, 0 217 | value :FAMILY_BULBASAUR, 1 218 | value :FAMILY_CHARMANDER, 4 219 | value :FAMILY_SQUIRTLE, 7 220 | value :FAMILY_CATERPIE, 10 221 | value :FAMILY_WEEDLE, 13 222 | value :FAMILY_PIDGEY, 16 223 | value :FAMILY_RATTATA, 19 224 | value :FAMILY_SPEAROW, 21 225 | value :FAMILY_EKANS, 23 226 | value :FAMILY_PIKACHU, 25 227 | value :FAMILY_SANDSHREW, 27 228 | value :FAMILY_NIDORAN_FEMALE, 29 229 | value :FAMILY_NIDORAN_MALE, 32 230 | value :FAMILY_CLEFAIRY, 35 231 | value :FAMILY_VULPIX, 37 232 | value :FAMILY_JIGGLYPUFF, 39 233 | value :FAMILY_ZUBAT, 41 234 | value :FAMILY_ODDISH, 43 235 | value :FAMILY_PARAS, 46 236 | value :FAMILY_VENONAT, 48 237 | value :FAMILY_DIGLETT, 50 238 | value :FAMILY_MEOWTH, 52 239 | value :FAMILY_PSYDUCK, 54 240 | value :FAMILY_MANKEY, 56 241 | value :FAMILY_GROWLITHE, 58 242 | value :FAMILY_POLIWAG, 60 243 | value :FAMILY_ABRA, 63 244 | value :FAMILY_MACHOP, 66 245 | value :FAMILY_BELLSPROUT, 69 246 | value :FAMILY_TENTACOOL, 72 247 | value :FAMILY_GEODUDE, 74 248 | value :FAMILY_PONYTA, 77 249 | value :FAMILY_SLOWPOKE, 79 250 | value :FAMILY_MAGNEMITE, 81 251 | value :FAMILY_FARFETCHD, 83 252 | value :FAMILY_DODUO, 84 253 | value :FAMILY_SEEL, 86 254 | value :FAMILY_GRIMER, 88 255 | value :FAMILY_SHELLDER, 90 256 | value :FAMILY_GASTLY, 92 257 | value :FAMILY_ONIX, 95 258 | value :FAMILY_DROWZEE, 96 259 | value :FAMILY_HYPNO, 97 260 | value :FAMILY_KRABBY, 98 261 | value :FAMILY_VOLTORB, 100 262 | value :FAMILY_EXEGGCUTE, 102 263 | value :FAMILY_CUBONE, 104 264 | value :FAMILY_HITMONLEE, 106 265 | value :FAMILY_HITMONCHAN, 107 266 | value :FAMILY_LICKITUNG, 108 267 | value :FAMILY_KOFFING, 109 268 | value :FAMILY_RHYHORN, 111 269 | value :FAMILY_CHANSEY, 113 270 | value :FAMILY_TANGELA, 114 271 | value :FAMILY_KANGASKHAN, 115 272 | value :FAMILY_HORSEA, 116 273 | value :FAMILY_GOLDEEN, 118 274 | value :FAMILY_STARYU, 120 275 | value :FAMILY_MR_MIME, 122 276 | value :FAMILY_SCYTHER, 123 277 | value :FAMILY_JYNX, 124 278 | value :FAMILY_ELECTABUZZ, 125 279 | value :FAMILY_MAGMAR, 126 280 | value :FAMILY_PINSIR, 127 281 | value :FAMILY_TAUROS, 128 282 | value :FAMILY_MAGIKARP, 129 283 | value :FAMILY_LAPRAS, 131 284 | value :FAMILY_DITTO, 132 285 | value :FAMILY_EEVEE, 133 286 | value :FAMILY_PORYGON, 137 287 | value :FAMILY_OMANYTE, 138 288 | value :FAMILY_KABUTO, 140 289 | value :FAMILY_AERODACTYL, 142 290 | value :FAMILY_SNORLAX, 143 291 | value :FAMILY_ARTICUNO, 144 292 | value :FAMILY_ZAPDOS, 145 293 | value :FAMILY_MOLTRES, 146 294 | value :FAMILY_DRATINI, 147 295 | value :FAMILY_MEWTWO, 150 296 | value :FAMILY_MEW, 151 297 | end 298 | add_enum "POGOProtos.Enums.CameraTarget" do 299 | value :CAM_TARGET_ATTACKER, 0 300 | value :CAM_TARGET_ATTACKER_EDGE, 1 301 | value :CAM_TARGET_ATTACKER_GROUND, 2 302 | value :CAM_TARGET_DEFENDER, 3 303 | value :CAM_TARGET_DEFENDER_EDGE, 4 304 | value :CAM_TARGET_DEFENDER_GROUND, 5 305 | value :CAM_TARGET_ATTACKER_DEFENDER, 6 306 | value :CAM_TARGET_ATTACKER_DEFENDER_EDGE, 7 307 | value :CAM_TARGET_DEFENDER_ATTACKER, 8 308 | value :CAM_TARGET_DEFENDER_ATTACKER_EDGE, 9 309 | value :CAM_TARGET_ATTACKER_DEFENDER_MIRROR, 11 310 | value :CAM_TARGET_SHOULDER_ATTACKER_DEFENDER, 12 311 | value :CAM_TARGET_SHOULDER_ATTACKER_DEFENDER_MIRROR, 13 312 | value :CAM_TARGET_ATTACKER_DEFENDER_WORLD, 14 313 | end 314 | add_enum "POGOProtos.Enums.ActivityType" do 315 | value :ACTIVITY_UNKNOWN, 0 316 | value :ACTIVITY_CATCH_POKEMON, 1 317 | value :ACTIVITY_CATCH_LEGEND_POKEMON, 2 318 | value :ACTIVITY_FLEE_POKEMON, 3 319 | value :ACTIVITY_DEFEAT_FORT, 4 320 | value :ACTIVITY_EVOLVE_POKEMON, 5 321 | value :ACTIVITY_HATCH_EGG, 6 322 | value :ACTIVITY_WALK_KM, 7 323 | value :ACTIVITY_POKEDEX_ENTRY_NEW, 8 324 | value :ACTIVITY_CATCH_FIRST_THROW, 9 325 | value :ACTIVITY_CATCH_NICE_THROW, 10 326 | value :ACTIVITY_CATCH_GREAT_THROW, 11 327 | value :ACTIVITY_CATCH_EXCELLENT_THROW, 12 328 | value :ACTIVITY_CATCH_CURVEBALL, 13 329 | value :ACTIVITY_CATCH_FIRST_CATCH_OF_DAY, 14 330 | value :ACTIVITY_CATCH_MILESTONE, 15 331 | value :ACTIVITY_TRAIN_POKEMON, 16 332 | value :ACTIVITY_SEARCH_FORT, 17 333 | value :ACTIVITY_RELEASE_POKEMON, 18 334 | value :ACTIVITY_HATCH_EGG_SMALL_BONUS, 19 335 | value :ACTIVITY_HATCH_EGG_MEDIUM_BONUS, 20 336 | value :ACTIVITY_HATCH_EGG_LARGE_BONUS, 21 337 | value :ACTIVITY_DEFEAT_GYM_DEFENDER, 22 338 | value :ACTIVITY_DEFEAT_GYM_LEADER, 23 339 | end 340 | add_enum "POGOProtos.Enums.PokemonRarity" do 341 | value :POKEMON_RARITY_NORMAL, 0 342 | value :POKEMON_RARITY_LEGENDARY, 1 343 | value :POKEMON_RARITY_MYTHIC, 2 344 | end 345 | add_enum "POGOProtos.Enums.HoloIapItemCategory" do 346 | value :IAP_CATEGORY_NONE, 0 347 | value :IAP_CATEGORY_BUNDLE, 1 348 | value :IAP_CATEGORY_ITEMS, 2 349 | value :IAP_CATEGORY_UPGRADES, 3 350 | value :IAP_CATEGORY_POKECOINS, 4 351 | end 352 | add_enum "POGOProtos.Enums.CameraInterpolation" do 353 | value :CAM_INTERP_CUT, 0 354 | value :CAM_INTERP_LINEAR, 1 355 | value :CAM_INTERP_SMOOTH, 2 356 | value :CAM_INTERP_SMOOTH_ROT_LINEAR_MOVE, 3 357 | value :CAM_INTERP_DEPENDS, 4 358 | end 359 | add_enum "POGOProtos.Enums.PokemonId" do 360 | value :MISSINGNO, 0 361 | value :BULBASAUR, 1 362 | value :IVYSAUR, 2 363 | value :VENUSAUR, 3 364 | value :CHARMANDER, 4 365 | value :CHARMELEON, 5 366 | value :CHARIZARD, 6 367 | value :SQUIRTLE, 7 368 | value :WARTORTLE, 8 369 | value :BLASTOISE, 9 370 | value :CATERPIE, 10 371 | value :METAPOD, 11 372 | value :BUTTERFREE, 12 373 | value :WEEDLE, 13 374 | value :KAKUNA, 14 375 | value :BEEDRILL, 15 376 | value :PIDGEY, 16 377 | value :PIDGEOTTO, 17 378 | value :PIDGEOT, 18 379 | value :RATTATA, 19 380 | value :RATICATE, 20 381 | value :SPEAROW, 21 382 | value :FEAROW, 22 383 | value :EKANS, 23 384 | value :ARBOK, 24 385 | value :PIKACHU, 25 386 | value :RAICHU, 26 387 | value :SANDSHREW, 27 388 | value :SANDSLASH, 28 389 | value :NIDORAN_FEMALE, 29 390 | value :NIDORINA, 30 391 | value :NIDOQUEEN, 31 392 | value :NIDORAN_MALE, 32 393 | value :NIDORINO, 33 394 | value :NIDOKING, 34 395 | value :CLEFAIRY, 35 396 | value :CLEFABLE, 36 397 | value :VULPIX, 37 398 | value :NINETALES, 38 399 | value :JIGGLYPUFF, 39 400 | value :WIGGLYTUFF, 40 401 | value :ZUBAT, 41 402 | value :GOLBAT, 42 403 | value :ODDISH, 43 404 | value :GLOOM, 44 405 | value :VILEPLUME, 45 406 | value :PARAS, 46 407 | value :PARASECT, 47 408 | value :VENONAT, 48 409 | value :VENOMOTH, 49 410 | value :DIGLETT, 50 411 | value :DUGTRIO, 51 412 | value :MEOWTH, 52 413 | value :PERSIAN, 53 414 | value :PSYDUCK, 54 415 | value :GOLDUCK, 55 416 | value :MANKEY, 56 417 | value :PRIMEAPE, 57 418 | value :GROWLITHE, 58 419 | value :ARCANINE, 59 420 | value :POLIWAG, 60 421 | value :POLIWHIRL, 61 422 | value :POLIWRATH, 62 423 | value :ABRA, 63 424 | value :KADABRA, 64 425 | value :ALAKAZAM, 65 426 | value :MACHOP, 66 427 | value :MACHOKE, 67 428 | value :MACHAMP, 68 429 | value :BELLSPROUT, 69 430 | value :WEEPINBELL, 70 431 | value :VICTREEBEL, 71 432 | value :TENTACOOL, 72 433 | value :TENTACRUEL, 73 434 | value :GEODUDE, 74 435 | value :GRAVELER, 75 436 | value :GOLEM, 76 437 | value :PONYTA, 77 438 | value :RAPIDASH, 78 439 | value :SLOWPOKE, 79 440 | value :SLOWBRO, 80 441 | value :MAGNEMITE, 81 442 | value :MAGNETON, 82 443 | value :FARFETCHD, 83 444 | value :DODUO, 84 445 | value :DODRIO, 85 446 | value :SEEL, 86 447 | value :DEWGONG, 87 448 | value :GRIMER, 88 449 | value :MUK, 89 450 | value :SHELLDER, 90 451 | value :CLOYSTER, 91 452 | value :GASTLY, 92 453 | value :HAUNTER, 93 454 | value :GENGAR, 94 455 | value :ONIX, 95 456 | value :DROWZEE, 96 457 | value :HYPNO, 97 458 | value :KRABBY, 98 459 | value :KINGLER, 99 460 | value :VOLTORB, 100 461 | value :ELECTRODE, 101 462 | value :EXEGGCUTE, 102 463 | value :EXEGGUTOR, 103 464 | value :CUBONE, 104 465 | value :MAROWAK, 105 466 | value :HITMONLEE, 106 467 | value :HITMONCHAN, 107 468 | value :LICKITUNG, 108 469 | value :KOFFING, 109 470 | value :WEEZING, 110 471 | value :RHYHORN, 111 472 | value :RHYDON, 112 473 | value :CHANSEY, 113 474 | value :TANGELA, 114 475 | value :KANGASKHAN, 115 476 | value :HORSEA, 116 477 | value :SEADRA, 117 478 | value :GOLDEEN, 118 479 | value :SEAKING, 119 480 | value :STARYU, 120 481 | value :STARMIE, 121 482 | value :MR_MIME, 122 483 | value :SCYTHER, 123 484 | value :JYNX, 124 485 | value :ELECTABUZZ, 125 486 | value :MAGMAR, 126 487 | value :PINSIR, 127 488 | value :TAUROS, 128 489 | value :MAGIKARP, 129 490 | value :GYARADOS, 130 491 | value :LAPRAS, 131 492 | value :DITTO, 132 493 | value :EEVEE, 133 494 | value :VAPOREON, 134 495 | value :JOLTEON, 135 496 | value :FLAREON, 136 497 | value :PORYGON, 137 498 | value :OMANYTE, 138 499 | value :OMASTAR, 139 500 | value :KABUTO, 140 501 | value :KABUTOPS, 141 502 | value :AERODACTYL, 142 503 | value :SNORLAX, 143 504 | value :ARTICUNO, 144 505 | value :ZAPDOS, 145 506 | value :MOLTRES, 146 507 | value :DRATINI, 147 508 | value :DRAGONAIR, 148 509 | value :DRAGONITE, 149 510 | value :MEWTWO, 150 511 | value :MEW, 151 512 | end 513 | add_enum "POGOProtos.Enums.PokemonMovementType" do 514 | value :MOVEMENT_STATIC, 0 515 | value :MOVEMENT_JUMP, 1 516 | value :MOVEMENT_VERTICAL, 2 517 | value :MOVEMENT_PSYCHIC, 3 518 | value :MOVEMENT_ELECTRIC, 4 519 | value :MOVEMENT_FLYING, 5 520 | value :MOVEMENT_HOVERING, 6 521 | end 522 | add_enum "POGOProtos.Enums.PokemonType" do 523 | value :POKEMON_TYPE_NONE, 0 524 | value :POKEMON_TYPE_NORMAL, 1 525 | value :POKEMON_TYPE_FIGHTING, 2 526 | value :POKEMON_TYPE_FLYING, 3 527 | value :POKEMON_TYPE_POISON, 4 528 | value :POKEMON_TYPE_GROUND, 5 529 | value :POKEMON_TYPE_ROCK, 6 530 | value :POKEMON_TYPE_BUG, 7 531 | value :POKEMON_TYPE_GHOST, 8 532 | value :POKEMON_TYPE_STEEL, 9 533 | value :POKEMON_TYPE_FIRE, 10 534 | value :POKEMON_TYPE_WATER, 11 535 | value :POKEMON_TYPE_GRASS, 12 536 | value :POKEMON_TYPE_ELECTRIC, 13 537 | value :POKEMON_TYPE_PSYCHIC, 14 538 | value :POKEMON_TYPE_ICE, 15 539 | value :POKEMON_TYPE_DRAGON, 16 540 | value :POKEMON_TYPE_DARK, 17 541 | value :POKEMON_TYPE_FAIRY, 18 542 | end 543 | add_enum "POGOProtos.Enums.BadgeType" do 544 | value :BADGE_UNSET, 0 545 | value :BADGE_TRAVEL_KM, 1 546 | value :BADGE_POKEDEX_ENTRIES, 2 547 | value :BADGE_CAPTURE_TOTAL, 3 548 | value :BADGE_DEFEATED_FORT, 4 549 | value :BADGE_EVOLVED_TOTAL, 5 550 | value :BADGE_HATCHED_TOTAL, 6 551 | value :BADGE_ENCOUNTERED_TOTAL, 7 552 | value :BADGE_POKESTOPS_VISITED, 8 553 | value :BADGE_UNIQUE_POKESTOPS, 9 554 | value :BADGE_POKEBALL_THROWN, 10 555 | value :BADGE_BIG_MAGIKARP, 11 556 | value :BADGE_DEPLOYED_TOTAL, 12 557 | value :BADGE_BATTLE_ATTACK_WON, 13 558 | value :BADGE_BATTLE_TRAINING_WON, 14 559 | value :BADGE_BATTLE_DEFEND_WON, 15 560 | value :BADGE_PRESTIGE_RAISED, 16 561 | value :BADGE_PRESTIGE_DROPPED, 17 562 | value :BADGE_TYPE_NORMAL, 18 563 | value :BADGE_TYPE_FIGHTING, 19 564 | value :BADGE_TYPE_FLYING, 20 565 | value :BADGE_TYPE_POISON, 21 566 | value :BADGE_TYPE_GROUND, 22 567 | value :BADGE_TYPE_ROCK, 23 568 | value :BADGE_TYPE_BUG, 24 569 | value :BADGE_TYPE_GHOST, 25 570 | value :BADGE_TYPE_STEEL, 26 571 | value :BADGE_TYPE_FIRE, 27 572 | value :BADGE_TYPE_WATER, 28 573 | value :BADGE_TYPE_GRASS, 29 574 | value :BADGE_TYPE_ELECTRIC, 30 575 | value :BADGE_TYPE_PSYCHIC, 31 576 | value :BADGE_TYPE_ICE, 32 577 | value :BADGE_TYPE_DRAGON, 33 578 | value :BADGE_TYPE_DARK, 34 579 | value :BADGE_TYPE_FAIRY, 35 580 | value :BADGE_SMALL_RATTATA, 36 581 | value :BADGE_PIKACHU, 37 582 | end 583 | add_enum "POGOProtos.Enums.Platform" do 584 | value :UNSET, 0 585 | value :IOS, 1 586 | value :ANDROID, 2 587 | value :OSX, 3 588 | value :WINDOWS, 4 589 | end 590 | add_enum "POGOProtos.Enums.Gender" do 591 | value :MALE, 0 592 | value :FEMALE, 1 593 | end 594 | add_enum "POGOProtos.Enums.TeamColor" do 595 | value :NEUTRAL, 0 596 | value :BLUE, 1 597 | value :RED, 2 598 | value :YELLOW, 3 599 | end 600 | add_enum "POGOProtos.Enums.ItemEffect" do 601 | value :ITEM_EFFECT_NONE, 0 602 | value :ITEM_EFFECT_CAP_NO_FLEE, 1000 603 | value :ITEM_EFFECT_CAP_NO_MOVEMENT, 1002 604 | value :ITEM_EFFECT_CAP_NO_THREAT, 1003 605 | value :ITEM_EFFECT_CAP_TARGET_MAX, 1004 606 | value :ITEM_EFFECT_CAP_TARGET_SLOW, 1005 607 | value :ITEM_EFFECT_CAP_CHANCE_NIGHT, 1006 608 | value :ITEM_EFFECT_CAP_CHANCE_TRAINER, 1007 609 | value :ITEM_EFFECT_CAP_CHANCE_FIRST_THROW, 1008 610 | value :ITEM_EFFECT_CAP_CHANCE_LEGEND, 1009 611 | value :ITEM_EFFECT_CAP_CHANCE_HEAVY, 1010 612 | value :ITEM_EFFECT_CAP_CHANCE_REPEAT, 1011 613 | value :ITEM_EFFECT_CAP_CHANCE_MULTI_THROW, 1012 614 | value :ITEM_EFFECT_CAP_CHANCE_ALWAYS, 1013 615 | value :ITEM_EFFECT_CAP_CHANCE_SINGLE_THROW, 1014 616 | end 617 | end 618 | 619 | module POGOProtos 620 | module Enums 621 | TutorialState = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.TutorialState").enummodule 622 | PokemonMove = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.PokemonMove").enummodule 623 | ItemCategory = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.ItemCategory").enummodule 624 | PokemonFamilyId = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.PokemonFamilyId").enummodule 625 | CameraTarget = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.CameraTarget").enummodule 626 | ActivityType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.ActivityType").enummodule 627 | PokemonRarity = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.PokemonRarity").enummodule 628 | HoloIapItemCategory = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.HoloIapItemCategory").enummodule 629 | CameraInterpolation = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.CameraInterpolation").enummodule 630 | PokemonId = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.PokemonId").enummodule 631 | PokemonMovementType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.PokemonMovementType").enummodule 632 | PokemonType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.PokemonType").enummodule 633 | BadgeType = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.BadgeType").enummodule 634 | Platform = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.Platform").enummodule 635 | Gender = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.Gender").enummodule 636 | TeamColor = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.TeamColor").enummodule 637 | ItemEffect = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Enums.ItemEffect").enummodule 638 | end 639 | end 640 | -------------------------------------------------------------------------------- /lib/poke-api/pogoprotos/pogoprotos_networking_responses.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: POGOProtos.Networking.Responses.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require_relative 'pogoprotos_data' 7 | require_relative 'pogoprotos_inventory' 8 | require_relative 'pogoprotos_data_capture' 9 | require_relative 'pogoprotos_map_pokemon' 10 | require_relative 'pogoprotos_data_logs' 11 | require_relative 'pogoprotos_settings' 12 | require_relative 'pogoprotos_inventory_item' 13 | require_relative 'pogoprotos_data_battle' 14 | require_relative 'pogoprotos_data_gym' 15 | require_relative 'pogoprotos_data_player' 16 | require_relative 'pogoprotos_enums' 17 | require_relative 'pogoprotos_settings_master' 18 | require_relative 'pogoprotos_map_fort' 19 | require_relative 'pogoprotos_map' 20 | Google::Protobuf::DescriptorPool.generated_pool.build do 21 | add_message "POGOProtos.Networking.Responses.SetContactSettingsResponse" do 22 | optional :status, :enum, 1, "POGOProtos.Networking.Responses.SetContactSettingsResponse.Status" 23 | optional :player_data, :message, 2, "POGOProtos.Data.PlayerData" 24 | end 25 | add_enum "POGOProtos.Networking.Responses.SetContactSettingsResponse.Status" do 26 | value :UNSET, 0 27 | value :SUCCESS, 1 28 | value :FAILURE, 2 29 | end 30 | add_message "POGOProtos.Networking.Responses.SetPlayerTeamResponse" do 31 | optional :status, :enum, 1, "POGOProtos.Networking.Responses.SetPlayerTeamResponse.Status" 32 | optional :player_data, :message, 2, "POGOProtos.Data.PlayerData" 33 | end 34 | add_enum "POGOProtos.Networking.Responses.SetPlayerTeamResponse.Status" do 35 | value :UNSET, 0 36 | value :SUCCESS, 1 37 | value :TEAM_ALREADY_SET, 2 38 | value :FAILURE, 3 39 | end 40 | add_message "POGOProtos.Networking.Responses.UpgradePokemonResponse" do 41 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.UpgradePokemonResponse.Result" 42 | optional :upgraded_pokemon, :message, 2, "POGOProtos.Data.PokemonData" 43 | end 44 | add_enum "POGOProtos.Networking.Responses.UpgradePokemonResponse.Result" do 45 | value :UNSET, 0 46 | value :SUCCESS, 1 47 | value :ERROR_POKEMON_NOT_FOUND, 2 48 | value :ERROR_INSUFFICIENT_RESOURCES, 3 49 | value :ERROR_UPGRADE_NOT_AVAILABLE, 4 50 | value :ERROR_POKEMON_IS_DEPLOYED, 5 51 | end 52 | add_message "POGOProtos.Networking.Responses.UseItemEggIncubatorResponse" do 53 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.UseItemEggIncubatorResponse.Result" 54 | optional :egg_incubator, :message, 2, "POGOProtos.Inventory.EggIncubator" 55 | end 56 | add_enum "POGOProtos.Networking.Responses.UseItemEggIncubatorResponse.Result" do 57 | value :UNSET, 0 58 | value :SUCCESS, 1 59 | value :ERROR_INCUBATOR_NOT_FOUND, 2 60 | value :ERROR_POKEMON_EGG_NOT_FOUND, 3 61 | value :ERROR_POKEMON_ID_NOT_EGG, 4 62 | value :ERROR_INCUBATOR_ALREADY_IN_USE, 5 63 | value :ERROR_POKEMON_ALREADY_INCUBATING, 6 64 | value :ERROR_INCUBATOR_NO_USES_REMAINING, 7 65 | end 66 | add_message "POGOProtos.Networking.Responses.EncounterResponse" do 67 | optional :wild_pokemon, :message, 1, "POGOProtos.Map.Pokemon.WildPokemon" 68 | optional :background, :enum, 2, "POGOProtos.Networking.Responses.EncounterResponse.Background" 69 | optional :status, :enum, 3, "POGOProtos.Networking.Responses.EncounterResponse.Status" 70 | optional :capture_probability, :message, 4, "POGOProtos.Data.Capture.CaptureProbability" 71 | end 72 | add_enum "POGOProtos.Networking.Responses.EncounterResponse.Background" do 73 | value :PARK, 0 74 | value :DESERT, 1 75 | end 76 | add_enum "POGOProtos.Networking.Responses.EncounterResponse.Status" do 77 | value :ENCOUNTER_ERROR, 0 78 | value :ENCOUNTER_SUCCESS, 1 79 | value :ENCOUNTER_NOT_FOUND, 2 80 | value :ENCOUNTER_CLOSED, 3 81 | value :ENCOUNTER_POKEMON_FLED, 4 82 | value :ENCOUNTER_NOT_IN_RANGE, 5 83 | value :ENCOUNTER_ALREADY_HAPPENED, 6 84 | value :POKEMON_INVENTORY_FULL, 7 85 | end 86 | add_message "POGOProtos.Networking.Responses.FortRecallPokemonResponse" do 87 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.FortRecallPokemonResponse.Result" 88 | optional :fort_details, :message, 2, "POGOProtos.Networking.Responses.FortDetailsResponse" 89 | end 90 | add_enum "POGOProtos.Networking.Responses.FortRecallPokemonResponse.Result" do 91 | value :NO_RESULT_SET, 0 92 | value :SUCCESS, 1 93 | value :ERROR_NOT_IN_RANGE, 2 94 | value :ERROR_POKEMON_NOT_ON_FORT, 3 95 | value :ERROR_NO_PLAYER, 4 96 | end 97 | add_message "POGOProtos.Networking.Responses.UseItemPotionResponse" do 98 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.UseItemPotionResponse.Result" 99 | optional :stamina, :int32, 2 100 | end 101 | add_enum "POGOProtos.Networking.Responses.UseItemPotionResponse.Result" do 102 | value :UNSET, 0 103 | value :SUCCESS, 1 104 | value :ERROR_NO_POKEMON, 2 105 | value :ERROR_CANNOT_USE, 3 106 | value :ERROR_DEPLOYED_TO_FORT, 4 107 | end 108 | add_message "POGOProtos.Networking.Responses.GetSuggestedCodenamesResponse" do 109 | repeated :codenames, :string, 1 110 | optional :success, :bool, 2 111 | end 112 | add_message "POGOProtos.Networking.Responses.DownloadRemoteConfigVersionResponse" do 113 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.DownloadRemoteConfigVersionResponse.Result" 114 | optional :item_templates_timestamp_ms, :uint64, 2 115 | optional :asset_digest_timestamp_ms, :uint64, 3 116 | end 117 | add_enum "POGOProtos.Networking.Responses.DownloadRemoteConfigVersionResponse.Result" do 118 | value :UNSET, 0 119 | value :SUCCESS, 1 120 | end 121 | add_message "POGOProtos.Networking.Responses.SfidaActionLogResponse" do 122 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.SfidaActionLogResponse.Result" 123 | repeated :log_entries, :message, 2, "POGOProtos.Data.Logs.ActionLogEntry" 124 | end 125 | add_enum "POGOProtos.Networking.Responses.SfidaActionLogResponse.Result" do 126 | value :UNSET, 0 127 | value :SUCCESS, 1 128 | end 129 | add_message "POGOProtos.Networking.Responses.DownloadSettingsResponse" do 130 | optional :error, :string, 1 131 | optional :hash, :string, 2 132 | optional :settings, :message, 3, "POGOProtos.Settings.GlobalSettings" 133 | end 134 | add_message "POGOProtos.Networking.Responses.GetDownloadUrlsResponse" do 135 | repeated :download_urls, :message, 1, "POGOProtos.Data.DownloadUrlEntry" 136 | end 137 | add_message "POGOProtos.Networking.Responses.EchoResponse" do 138 | optional :context, :string, 1 139 | end 140 | add_message "POGOProtos.Networking.Responses.GetAssetDigestResponse" do 141 | repeated :digest, :message, 1, "POGOProtos.Data.AssetDigestEntry" 142 | optional :timestamp_ms, :uint64, 2 143 | end 144 | add_message "POGOProtos.Networking.Responses.GetPlayerProfileResponse" do 145 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.GetPlayerProfileResponse.Result" 146 | optional :start_time, :int64, 2 147 | repeated :badges, :message, 3, "POGOProtos.Data.PlayerBadge" 148 | end 149 | add_enum "POGOProtos.Networking.Responses.GetPlayerProfileResponse.Result" do 150 | value :UNSET, 0 151 | value :SUCCESS, 1 152 | end 153 | add_message "POGOProtos.Networking.Responses.UseItemGymResponse" do 154 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.UseItemGymResponse.Result" 155 | optional :updated_gp, :int64, 2 156 | end 157 | add_enum "POGOProtos.Networking.Responses.UseItemGymResponse.Result" do 158 | value :UNSET, 0 159 | value :SUCCESS, 1 160 | value :ERROR_CANNOT_USE, 2 161 | value :ERROR_NOT_IN_RANGE, 3 162 | end 163 | add_message "POGOProtos.Networking.Responses.FortSearchResponse" do 164 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.FortSearchResponse.Result" 165 | repeated :items_awarded, :message, 2, "POGOProtos.Inventory.Item.ItemAward" 166 | optional :gems_awarded, :int32, 3 167 | optional :pokemon_data_egg, :message, 4, "POGOProtos.Data.PokemonData" 168 | optional :experience_awarded, :int32, 5 169 | optional :cooldown_complete_timestamp_ms, :int64, 6 170 | optional :chain_hack_sequence_number, :int32, 7 171 | end 172 | add_enum "POGOProtos.Networking.Responses.FortSearchResponse.Result" do 173 | value :NO_RESULT_SET, 0 174 | value :SUCCESS, 1 175 | value :OUT_OF_RANGE, 2 176 | value :IN_COOLDOWN_PERIOD, 3 177 | value :INVENTORY_FULL, 4 178 | end 179 | add_message "POGOProtos.Networking.Responses.GetHatchedEggsResponse" do 180 | optional :success, :bool, 1 181 | repeated :pokemon_id, :fixed64, 2 182 | repeated :experience_awarded, :int32, 3 183 | repeated :candy_awarded, :int32, 4 184 | repeated :stardust_awarded, :int32, 5 185 | end 186 | add_message "POGOProtos.Networking.Responses.UseItemXpBoostResponse" do 187 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.UseItemXpBoostResponse.Result" 188 | optional :applied_items, :message, 2, "POGOProtos.Inventory.AppliedItems" 189 | end 190 | add_enum "POGOProtos.Networking.Responses.UseItemXpBoostResponse.Result" do 191 | value :UNSET, 0 192 | value :SUCCESS, 1 193 | value :ERROR_INVALID_ITEM_TYPE, 2 194 | value :ERROR_XP_BOOST_ALREADY_ACTIVE, 3 195 | value :ERROR_NO_ITEMS_REMAINING, 4 196 | value :ERROR_LOCATION_UNSET, 5 197 | end 198 | add_message "POGOProtos.Networking.Responses.StartGymBattleResponse" do 199 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.StartGymBattleResponse.Result" 200 | optional :battle_start_timestamp_ms, :int64, 2 201 | optional :battle_end_timestamp_ms, :int64, 3 202 | optional :battle_id, :string, 4 203 | optional :defender, :message, 5, "POGOProtos.Data.Battle.BattleParticipant" 204 | optional :battle_log, :message, 6, "POGOProtos.Data.Battle.BattleLog" 205 | end 206 | add_enum "POGOProtos.Networking.Responses.StartGymBattleResponse.Result" do 207 | value :UNSET, 0 208 | value :SUCCESS, 1 209 | value :ERROR_GYM_NOT_FOUND, 2 210 | value :ERROR_GYM_NEUTRAL, 3 211 | value :ERROR_GYM_WRONG_TEAM, 4 212 | value :ERROR_GYM_EMPTY, 5 213 | value :ERROR_INVALID_DEFENDER, 6 214 | value :ERROR_TRAINING_INVALID_ATTACKER_COUNT, 7 215 | value :ERROR_ALL_POKEMON_FAINTED, 8 216 | value :ERROR_TOO_MANY_BATTLES, 9 217 | value :ERROR_TOO_MANY_PLAYERS, 10 218 | value :ERROR_GYM_BATTLE_LOCKOUT, 11 219 | value :ERROR_PLAYER_BELOW_MINIMUM_LEVEL, 12 220 | value :ERROR_NOT_IN_RANGE, 13 221 | end 222 | add_message "POGOProtos.Networking.Responses.IncenseEncounterResponse" do 223 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.IncenseEncounterResponse.Result" 224 | optional :pokemon_data, :message, 2, "POGOProtos.Data.PokemonData" 225 | optional :capture_probability, :message, 3, "POGOProtos.Data.Capture.CaptureProbability" 226 | end 227 | add_enum "POGOProtos.Networking.Responses.IncenseEncounterResponse.Result" do 228 | value :INCENSE_ENCOUNTER_UNKNOWN, 0 229 | value :INCENSE_ENCOUNTER_SUCCESS, 1 230 | value :INCENSE_ENCOUNTER_NOT_AVAILABLE, 2 231 | value :POKEMON_INVENTORY_FULL, 3 232 | end 233 | add_message "POGOProtos.Networking.Responses.GetGymDetailsResponse" do 234 | optional :gym_state, :message, 1, "POGOProtos.Data.Gym.GymState" 235 | optional :name, :string, 2 236 | repeated :urls, :string, 3 237 | optional :result, :enum, 4, "POGOProtos.Networking.Responses.GetGymDetailsResponse.Result" 238 | optional :description, :string, 5 239 | end 240 | add_enum "POGOProtos.Networking.Responses.GetGymDetailsResponse.Result" do 241 | value :UNSET, 0 242 | value :SUCCESS, 1 243 | value :ERROR_NOT_IN_RANGE, 2 244 | end 245 | add_message "POGOProtos.Networking.Responses.SetFavoritePokemonResponse" do 246 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.SetFavoritePokemonResponse.Result" 247 | end 248 | add_enum "POGOProtos.Networking.Responses.SetFavoritePokemonResponse.Result" do 249 | value :UNSET, 0 250 | value :SUCCESS, 1 251 | value :ERROR_POKEMON_NOT_FOUND, 2 252 | value :ERROR_POKEMON_IS_EGG, 3 253 | end 254 | add_message "POGOProtos.Networking.Responses.EvolvePokemonResponse" do 255 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.EvolvePokemonResponse.Result" 256 | optional :evolved_pokemon_data, :message, 2, "POGOProtos.Data.PokemonData" 257 | optional :experience_awarded, :int32, 3 258 | optional :candy_awarded, :int32, 4 259 | end 260 | add_enum "POGOProtos.Networking.Responses.EvolvePokemonResponse.Result" do 261 | value :UNSET, 0 262 | value :SUCCESS, 1 263 | value :FAILED_POKEMON_MISSING, 2 264 | value :FAILED_INSUFFICIENT_RESOURCES, 3 265 | value :FAILED_POKEMON_CANNOT_EVOLVE, 4 266 | value :FAILED_POKEMON_IS_DEPLOYED, 5 267 | end 268 | add_message "POGOProtos.Networking.Responses.GetInventoryResponse" do 269 | optional :success, :bool, 1 270 | optional :inventory_delta, :message, 2, "POGOProtos.Inventory.InventoryDelta" 271 | end 272 | add_message "POGOProtos.Networking.Responses.EquipBadgeResponse" do 273 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.EquipBadgeResponse.Result" 274 | optional :equipped, :message, 2, "POGOProtos.Data.Player.EquippedBadge" 275 | end 276 | add_enum "POGOProtos.Networking.Responses.EquipBadgeResponse.Result" do 277 | value :UNSET, 0 278 | value :SUCCESS, 1 279 | value :COOLDOWN_ACTIVE, 2 280 | value :NOT_QUALIFIED, 3 281 | end 282 | add_message "POGOProtos.Networking.Responses.CheckAwardedBadgesResponse" do 283 | optional :success, :bool, 1 284 | repeated :awarded_badges, :enum, 2, "POGOProtos.Enums.BadgeType" 285 | repeated :awarded_badge_levels, :int32, 3 286 | end 287 | add_message "POGOProtos.Networking.Responses.NicknamePokemonResponse" do 288 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.NicknamePokemonResponse.Result" 289 | end 290 | add_enum "POGOProtos.Networking.Responses.NicknamePokemonResponse.Result" do 291 | value :UNSET, 0 292 | value :SUCCESS, 1 293 | value :ERROR_INVALID_NICKNAME, 2 294 | value :ERROR_POKEMON_NOT_FOUND, 3 295 | value :ERROR_POKEMON_IS_EGG, 4 296 | end 297 | add_message "POGOProtos.Networking.Responses.DownloadItemTemplatesResponse" do 298 | optional :success, :bool, 1 299 | repeated :item_templates, :message, 2, "POGOProtos.Networking.Responses.DownloadItemTemplatesResponse.ItemTemplate" 300 | optional :timestamp_ms, :uint64, 3 301 | end 302 | add_message "POGOProtos.Networking.Responses.DownloadItemTemplatesResponse.ItemTemplate" do 303 | optional :template_id, :string, 1 304 | optional :pokemon_settings, :message, 2, "POGOProtos.Settings.Master.PokemonSettings" 305 | optional :item_settings, :message, 3, "POGOProtos.Settings.Master.ItemSettings" 306 | optional :move_settings, :message, 4, "POGOProtos.Settings.Master.MoveSettings" 307 | optional :move_sequence_settings, :message, 5, "POGOProtos.Settings.Master.MoveSequenceSettings" 308 | optional :type_effective, :message, 8, "POGOProtos.Settings.Master.TypeEffectiveSettings" 309 | optional :badge_settings, :message, 10, "POGOProtos.Settings.Master.BadgeSettings" 310 | optional :camera, :message, 11, "POGOProtos.Settings.Master.CameraSettings" 311 | optional :player_level, :message, 12, "POGOProtos.Settings.Master.PlayerLevelSettings" 312 | optional :gym_level, :message, 13, "POGOProtos.Settings.Master.GymLevelSettings" 313 | optional :battle_settings, :message, 14, "POGOProtos.Settings.Master.GymBattleSettings" 314 | optional :encounter_settings, :message, 15, "POGOProtos.Settings.Master.EncounterSettings" 315 | optional :iap_item_display, :message, 16, "POGOProtos.Settings.Master.IapItemDisplay" 316 | optional :iap_settings, :message, 17, "POGOProtos.Settings.Master.IapSettings" 317 | optional :pokemon_upgrades, :message, 18, "POGOProtos.Settings.Master.PokemonUpgradeSettings" 318 | optional :equipped_badges, :message, 19, "POGOProtos.Settings.Master.EquippedBadgeSettings" 319 | end 320 | add_message "POGOProtos.Networking.Responses.UseItemCaptureResponse" do 321 | optional :success, :bool, 1 322 | optional :item_capture_mult, :double, 2 323 | optional :item_flee_mult, :double, 3 324 | optional :stop_movement, :bool, 4 325 | optional :stop_attack, :bool, 5 326 | optional :target_max, :bool, 6 327 | optional :target_slow, :bool, 7 328 | end 329 | add_message "POGOProtos.Networking.Responses.DiskEncounterResponse" do 330 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.DiskEncounterResponse.Result" 331 | optional :pokemon_data, :message, 2, "POGOProtos.Data.PokemonData" 332 | optional :capture_probability, :message, 3, "POGOProtos.Data.Capture.CaptureProbability" 333 | end 334 | add_enum "POGOProtos.Networking.Responses.DiskEncounterResponse.Result" do 335 | value :UNKNOWN, 0 336 | value :SUCCESS, 1 337 | value :NOT_AVAILABLE, 2 338 | value :NOT_IN_RANGE, 3 339 | value :ENCOUNTER_ALREADY_FINISHED, 4 340 | value :POKEMON_INVENTORY_FULL, 5 341 | end 342 | add_message "POGOProtos.Networking.Responses.LevelUpRewardsResponse" do 343 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.LevelUpRewardsResponse.Result" 344 | repeated :items_awarded, :message, 2, "POGOProtos.Inventory.Item.ItemAward" 345 | repeated :items_unlocked, :enum, 4, "POGOProtos.Inventory.Item.ItemId" 346 | end 347 | add_enum "POGOProtos.Networking.Responses.LevelUpRewardsResponse.Result" do 348 | value :UNSET, 0 349 | value :SUCCESS, 1 350 | value :AWARDED_ALREADY, 2 351 | end 352 | add_message "POGOProtos.Networking.Responses.PlayerUpdateResponse" do 353 | repeated :wild_pokemons, :message, 1, "POGOProtos.Map.Pokemon.WildPokemon" 354 | repeated :forts, :message, 2, "POGOProtos.Map.Fort.FortData" 355 | optional :forts_nearby, :int32, 3 356 | end 357 | add_message "POGOProtos.Networking.Responses.MarkTutorialCompleteResponse" do 358 | optional :success, :bool, 1 359 | optional :player_data, :message, 2, "POGOProtos.Data.PlayerData" 360 | end 361 | add_message "POGOProtos.Networking.Responses.ReleasePokemonResponse" do 362 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.ReleasePokemonResponse.Result" 363 | optional :candy_awarded, :int32, 2 364 | end 365 | add_enum "POGOProtos.Networking.Responses.ReleasePokemonResponse.Result" do 366 | value :UNSET, 0 367 | value :SUCCESS, 1 368 | value :POKEMON_DEPLOYED, 2 369 | value :FAILED, 3 370 | value :ERROR_POKEMON_IS_EGG, 4 371 | end 372 | add_message "POGOProtos.Networking.Responses.CollectDailyDefenderBonusResponse" do 373 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.CollectDailyDefenderBonusResponse.Result" 374 | repeated :currency_type, :string, 2 375 | repeated :currency_awarded, :int32, 3 376 | optional :defenders_count, :int32, 4 377 | end 378 | add_enum "POGOProtos.Networking.Responses.CollectDailyDefenderBonusResponse.Result" do 379 | value :UNSET, 0 380 | value :SUCCESS, 1 381 | value :FAILURE, 2 382 | value :TOO_SOON, 3 383 | value :NO_DEFENDERS, 4 384 | end 385 | add_message "POGOProtos.Networking.Responses.GetMapObjectsResponse" do 386 | repeated :map_cells, :message, 1, "POGOProtos.Map.MapCell" 387 | optional :status, :enum, 2, "POGOProtos.Map.MapObjectsStatus" 388 | end 389 | add_message "POGOProtos.Networking.Responses.CheckCodenameAvailableResponse" do 390 | optional :codename, :string, 1 391 | optional :user_message, :string, 2 392 | optional :is_assignable, :bool, 3 393 | optional :status, :enum, 4, "POGOProtos.Networking.Responses.CheckCodenameAvailableResponse.Status" 394 | end 395 | add_enum "POGOProtos.Networking.Responses.CheckCodenameAvailableResponse.Status" do 396 | value :UNSET, 0 397 | value :SUCCESS, 1 398 | value :CODENAME_NOT_AVAILABLE, 2 399 | value :CODENAME_NOT_VALID, 3 400 | value :CURRENT_OWNER, 4 401 | value :CODENAME_CHANGE_NOT_ALLOWED, 5 402 | end 403 | add_message "POGOProtos.Networking.Responses.UseIncenseResponse" do 404 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.UseIncenseResponse.Result" 405 | optional :applied_incense, :message, 2, "POGOProtos.Inventory.AppliedItem" 406 | end 407 | add_enum "POGOProtos.Networking.Responses.UseIncenseResponse.Result" do 408 | value :UNKNOWN, 0 409 | value :SUCCESS, 1 410 | value :INCENSE_ALREADY_ACTIVE, 2 411 | value :NONE_IN_INVENTORY, 3 412 | value :LOCATION_UNSET, 4 413 | end 414 | add_message "POGOProtos.Networking.Responses.ClaimCodenameResponse" do 415 | optional :codename, :string, 1 416 | optional :user_message, :string, 2 417 | optional :is_assignable, :bool, 3 418 | optional :status, :enum, 4, "POGOProtos.Networking.Responses.ClaimCodenameResponse.Status" 419 | optional :updated_player, :message, 5, "POGOProtos.Data.PlayerData" 420 | end 421 | add_enum "POGOProtos.Networking.Responses.ClaimCodenameResponse.Status" do 422 | value :UNSET, 0 423 | value :SUCCESS, 1 424 | value :CODENAME_NOT_AVAILABLE, 2 425 | value :CODENAME_NOT_VALID, 3 426 | value :CURRENT_OWNER, 4 427 | value :CODENAME_CHANGE_NOT_ALLOWED, 5 428 | end 429 | add_message "POGOProtos.Networking.Responses.AddFortModifierResponse" do 430 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.AddFortModifierResponse.Result" 431 | optional :fort_details, :message, 2, "POGOProtos.Networking.Responses.FortDetailsResponse" 432 | end 433 | add_enum "POGOProtos.Networking.Responses.AddFortModifierResponse.Result" do 434 | value :NO_RESULT_SET, 0 435 | value :SUCCESS, 1 436 | value :FORT_ALREADY_HAS_MODIFIER, 2 437 | value :TOO_FAR_AWAY, 3 438 | value :NO_ITEM_IN_INVENTORY, 4 439 | end 440 | add_message "POGOProtos.Networking.Responses.CatchPokemonResponse" do 441 | optional :status, :enum, 1, "POGOProtos.Networking.Responses.CatchPokemonResponse.CatchStatus" 442 | optional :miss_percent, :double, 2 443 | optional :captured_pokemon_id, :fixed64, 3 444 | optional :capture_award, :message, 4, "POGOProtos.Data.Capture.CaptureAward" 445 | end 446 | add_enum "POGOProtos.Networking.Responses.CatchPokemonResponse.CatchStatus" do 447 | value :CATCH_ERROR, 0 448 | value :CATCH_SUCCESS, 1 449 | value :CATCH_ESCAPE, 2 450 | value :CATCH_FLEE, 3 451 | value :CATCH_MISSED, 4 452 | end 453 | add_message "POGOProtos.Networking.Responses.UseItemReviveResponse" do 454 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.UseItemReviveResponse.Result" 455 | optional :stamina, :int32, 2 456 | end 457 | add_enum "POGOProtos.Networking.Responses.UseItemReviveResponse.Result" do 458 | value :UNSET, 0 459 | value :SUCCESS, 1 460 | value :ERROR_NO_POKEMON, 2 461 | value :ERROR_CANNOT_USE, 3 462 | value :ERROR_DEPLOYED_TO_FORT, 4 463 | end 464 | add_message "POGOProtos.Networking.Responses.GetIncensePokemonResponse" do 465 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.GetIncensePokemonResponse.Result" 466 | optional :pokemon_id, :enum, 2, "POGOProtos.Enums.PokemonId" 467 | optional :latitude, :double, 3 468 | optional :longitude, :double, 4 469 | optional :encounter_location, :string, 5 470 | optional :encounter_id, :fixed64, 6 471 | optional :disappear_timestamp_ms, :int64, 7 472 | end 473 | add_enum "POGOProtos.Networking.Responses.GetIncensePokemonResponse.Result" do 474 | value :INCENSE_ENCOUNTER_UNKNOWN, 0 475 | value :INCENSE_ENCOUNTER_AVAILABLE, 1 476 | value :INCENSE_ENCOUNTER_NOT_AVAILABLE, 2 477 | end 478 | add_message "POGOProtos.Networking.Responses.FortDetailsResponse" do 479 | optional :fort_id, :string, 1 480 | optional :team_color, :enum, 2, "POGOProtos.Enums.TeamColor" 481 | optional :pokemon_data, :message, 3, "POGOProtos.Data.PokemonData" 482 | optional :name, :string, 4 483 | repeated :image_urls, :string, 5 484 | optional :fp, :int32, 6 485 | optional :stamina, :int32, 7 486 | optional :max_stamina, :int32, 8 487 | optional :type, :enum, 9, "POGOProtos.Map.Fort.FortType" 488 | optional :latitude, :double, 10 489 | optional :longitude, :double, 11 490 | optional :description, :string, 12 491 | repeated :modifiers, :message, 13, "POGOProtos.Map.Fort.FortModifier" 492 | end 493 | add_message "POGOProtos.Networking.Responses.CollectDailyBonusResponse" do 494 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.CollectDailyBonusResponse.Result" 495 | end 496 | add_enum "POGOProtos.Networking.Responses.CollectDailyBonusResponse.Result" do 497 | value :UNSET, 0 498 | value :SUCCESS, 1 499 | value :FAILURE, 2 500 | value :TOO_SOON, 3 501 | end 502 | add_message "POGOProtos.Networking.Responses.EncounterTutorialCompleteResponse" do 503 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.EncounterTutorialCompleteResponse.Result" 504 | optional :pokemon_data, :message, 2, "POGOProtos.Data.PokemonData" 505 | optional :capture_award, :message, 3, "POGOProtos.Data.Capture.CaptureAward" 506 | end 507 | add_enum "POGOProtos.Networking.Responses.EncounterTutorialCompleteResponse.Result" do 508 | value :UNSET, 0 509 | value :SUCCESS, 1 510 | value :ERROR_INVALID_POKEMON, 2 511 | end 512 | add_message "POGOProtos.Networking.Responses.RecycleInventoryItemResponse" do 513 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.RecycleInventoryItemResponse.Result" 514 | optional :new_count, :int32, 2 515 | end 516 | add_enum "POGOProtos.Networking.Responses.RecycleInventoryItemResponse.Result" do 517 | value :UNSET, 0 518 | value :SUCCESS, 1 519 | value :ERROR_NOT_ENOUGH_COPIES, 2 520 | value :ERROR_CANNOT_RECYCLE_INCUBATORS, 3 521 | end 522 | add_message "POGOProtos.Networking.Responses.FortDeployPokemonResponse" do 523 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.FortDeployPokemonResponse.Result" 524 | optional :fort_details, :message, 2, "POGOProtos.Networking.Responses.FortDetailsResponse" 525 | optional :pokemon_data, :message, 3, "POGOProtos.Data.PokemonData" 526 | optional :gym_state, :message, 4, "POGOProtos.Data.Gym.GymState" 527 | end 528 | add_enum "POGOProtos.Networking.Responses.FortDeployPokemonResponse.Result" do 529 | value :NO_RESULT_SET, 0 530 | value :SUCCESS, 1 531 | value :ERROR_ALREADY_HAS_POKEMON_ON_FORT, 2 532 | value :ERROR_OPPOSING_TEAM_OWNS_FORT, 3 533 | value :ERROR_FORT_IS_FULL, 4 534 | value :ERROR_NOT_IN_RANGE, 5 535 | value :ERROR_PLAYER_HAS_NO_TEAM, 6 536 | value :ERROR_POKEMON_NOT_FULL_HP, 7 537 | value :ERROR_PLAYER_BELOW_MINIMUM_LEVEL, 8 538 | end 539 | add_message "POGOProtos.Networking.Responses.SetAvatarResponse" do 540 | optional :status, :enum, 1, "POGOProtos.Networking.Responses.SetAvatarResponse.Status" 541 | optional :player_data, :message, 2, "POGOProtos.Data.PlayerData" 542 | end 543 | add_enum "POGOProtos.Networking.Responses.SetAvatarResponse.Status" do 544 | value :UNSET, 0 545 | value :SUCCESS, 1 546 | value :AVATAR_ALREADY_SET, 2 547 | value :FAILURE, 3 548 | end 549 | add_message "POGOProtos.Networking.Responses.AttackGymResponse" do 550 | optional :result, :enum, 1, "POGOProtos.Networking.Responses.AttackGymResponse.Result" 551 | optional :battle_log, :message, 2, "POGOProtos.Data.Battle.BattleLog" 552 | optional :battle_id, :string, 3 553 | optional :active_defender, :message, 4, "POGOProtos.Data.Battle.BattlePokemonInfo" 554 | optional :active_attacker, :message, 5, "POGOProtos.Data.Battle.BattlePokemonInfo" 555 | end 556 | add_enum "POGOProtos.Networking.Responses.AttackGymResponse.Result" do 557 | value :UNSET, 0 558 | value :SUCCESS, 1 559 | value :ERROR_INVALID_ATTACK_ACTIONS, 2 560 | value :ERROR_NOT_IN_RANGE, 3 561 | end 562 | add_message "POGOProtos.Networking.Responses.GetPlayerResponse" do 563 | optional :success, :bool, 1 564 | optional :player_data, :message, 2, "POGOProtos.Data.PlayerData" 565 | end 566 | end 567 | 568 | module POGOProtos 569 | module Networking 570 | module Responses 571 | SetContactSettingsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SetContactSettingsResponse").msgclass 572 | SetContactSettingsResponse::Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SetContactSettingsResponse.Status").enummodule 573 | SetPlayerTeamResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SetPlayerTeamResponse").msgclass 574 | SetPlayerTeamResponse::Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SetPlayerTeamResponse.Status").enummodule 575 | UpgradePokemonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UpgradePokemonResponse").msgclass 576 | UpgradePokemonResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UpgradePokemonResponse.Result").enummodule 577 | UseItemEggIncubatorResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemEggIncubatorResponse").msgclass 578 | UseItemEggIncubatorResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemEggIncubatorResponse.Result").enummodule 579 | EncounterResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EncounterResponse").msgclass 580 | EncounterResponse::Background = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EncounterResponse.Background").enummodule 581 | EncounterResponse::Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EncounterResponse.Status").enummodule 582 | FortRecallPokemonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.FortRecallPokemonResponse").msgclass 583 | FortRecallPokemonResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.FortRecallPokemonResponse.Result").enummodule 584 | UseItemPotionResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemPotionResponse").msgclass 585 | UseItemPotionResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemPotionResponse.Result").enummodule 586 | GetSuggestedCodenamesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetSuggestedCodenamesResponse").msgclass 587 | DownloadRemoteConfigVersionResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.DownloadRemoteConfigVersionResponse").msgclass 588 | DownloadRemoteConfigVersionResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.DownloadRemoteConfigVersionResponse.Result").enummodule 589 | SfidaActionLogResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SfidaActionLogResponse").msgclass 590 | SfidaActionLogResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SfidaActionLogResponse.Result").enummodule 591 | DownloadSettingsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.DownloadSettingsResponse").msgclass 592 | GetDownloadUrlsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetDownloadUrlsResponse").msgclass 593 | EchoResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EchoResponse").msgclass 594 | GetAssetDigestResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetAssetDigestResponse").msgclass 595 | GetPlayerProfileResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetPlayerProfileResponse").msgclass 596 | GetPlayerProfileResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetPlayerProfileResponse.Result").enummodule 597 | UseItemGymResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemGymResponse").msgclass 598 | UseItemGymResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemGymResponse.Result").enummodule 599 | FortSearchResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.FortSearchResponse").msgclass 600 | FortSearchResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.FortSearchResponse.Result").enummodule 601 | GetHatchedEggsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetHatchedEggsResponse").msgclass 602 | UseItemXpBoostResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemXpBoostResponse").msgclass 603 | UseItemXpBoostResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemXpBoostResponse.Result").enummodule 604 | StartGymBattleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.StartGymBattleResponse").msgclass 605 | StartGymBattleResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.StartGymBattleResponse.Result").enummodule 606 | IncenseEncounterResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.IncenseEncounterResponse").msgclass 607 | IncenseEncounterResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.IncenseEncounterResponse.Result").enummodule 608 | GetGymDetailsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetGymDetailsResponse").msgclass 609 | GetGymDetailsResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetGymDetailsResponse.Result").enummodule 610 | SetFavoritePokemonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SetFavoritePokemonResponse").msgclass 611 | SetFavoritePokemonResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SetFavoritePokemonResponse.Result").enummodule 612 | EvolvePokemonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EvolvePokemonResponse").msgclass 613 | EvolvePokemonResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EvolvePokemonResponse.Result").enummodule 614 | GetInventoryResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetInventoryResponse").msgclass 615 | EquipBadgeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EquipBadgeResponse").msgclass 616 | EquipBadgeResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EquipBadgeResponse.Result").enummodule 617 | CheckAwardedBadgesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.CheckAwardedBadgesResponse").msgclass 618 | NicknamePokemonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.NicknamePokemonResponse").msgclass 619 | NicknamePokemonResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.NicknamePokemonResponse.Result").enummodule 620 | DownloadItemTemplatesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.DownloadItemTemplatesResponse").msgclass 621 | DownloadItemTemplatesResponse::ItemTemplate = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.DownloadItemTemplatesResponse.ItemTemplate").msgclass 622 | UseItemCaptureResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemCaptureResponse").msgclass 623 | DiskEncounterResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.DiskEncounterResponse").msgclass 624 | DiskEncounterResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.DiskEncounterResponse.Result").enummodule 625 | LevelUpRewardsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.LevelUpRewardsResponse").msgclass 626 | LevelUpRewardsResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.LevelUpRewardsResponse.Result").enummodule 627 | PlayerUpdateResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.PlayerUpdateResponse").msgclass 628 | MarkTutorialCompleteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.MarkTutorialCompleteResponse").msgclass 629 | ReleasePokemonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.ReleasePokemonResponse").msgclass 630 | ReleasePokemonResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.ReleasePokemonResponse.Result").enummodule 631 | CollectDailyDefenderBonusResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.CollectDailyDefenderBonusResponse").msgclass 632 | CollectDailyDefenderBonusResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.CollectDailyDefenderBonusResponse.Result").enummodule 633 | GetMapObjectsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetMapObjectsResponse").msgclass 634 | CheckCodenameAvailableResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.CheckCodenameAvailableResponse").msgclass 635 | CheckCodenameAvailableResponse::Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.CheckCodenameAvailableResponse.Status").enummodule 636 | UseIncenseResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseIncenseResponse").msgclass 637 | UseIncenseResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseIncenseResponse.Result").enummodule 638 | ClaimCodenameResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.ClaimCodenameResponse").msgclass 639 | ClaimCodenameResponse::Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.ClaimCodenameResponse.Status").enummodule 640 | AddFortModifierResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.AddFortModifierResponse").msgclass 641 | AddFortModifierResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.AddFortModifierResponse.Result").enummodule 642 | CatchPokemonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.CatchPokemonResponse").msgclass 643 | CatchPokemonResponse::CatchStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.CatchPokemonResponse.CatchStatus").enummodule 644 | UseItemReviveResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemReviveResponse").msgclass 645 | UseItemReviveResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.UseItemReviveResponse.Result").enummodule 646 | GetIncensePokemonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetIncensePokemonResponse").msgclass 647 | GetIncensePokemonResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetIncensePokemonResponse.Result").enummodule 648 | FortDetailsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.FortDetailsResponse").msgclass 649 | CollectDailyBonusResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.CollectDailyBonusResponse").msgclass 650 | CollectDailyBonusResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.CollectDailyBonusResponse.Result").enummodule 651 | EncounterTutorialCompleteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EncounterTutorialCompleteResponse").msgclass 652 | EncounterTutorialCompleteResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.EncounterTutorialCompleteResponse.Result").enummodule 653 | RecycleInventoryItemResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.RecycleInventoryItemResponse").msgclass 654 | RecycleInventoryItemResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.RecycleInventoryItemResponse.Result").enummodule 655 | FortDeployPokemonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.FortDeployPokemonResponse").msgclass 656 | FortDeployPokemonResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.FortDeployPokemonResponse.Result").enummodule 657 | SetAvatarResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SetAvatarResponse").msgclass 658 | SetAvatarResponse::Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.SetAvatarResponse.Status").enummodule 659 | AttackGymResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.AttackGymResponse").msgclass 660 | AttackGymResponse::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.AttackGymResponse.Result").enummodule 661 | GetPlayerResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("POGOProtos.Networking.Responses.GetPlayerResponse").msgclass 662 | end 663 | end 664 | end 665 | --------------------------------------------------------------------------------