Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realistic geolocation altitudes #4106

Closed
gfreivasc opened this issue Aug 16, 2016 · 6 comments
Closed

Realistic geolocation altitudes #4106

gfreivasc opened this issue Aug 16, 2016 · 6 comments

Comments

@gfreivasc
Copy link
Contributor

gfreivasc commented Aug 16, 2016

Short Description

Currently the bot only sends coordinates with consant altitude to Niantic servers, this could be a way of detecting bot users. Geospacial shapes are not flat and a simple SQL query on stored locations could tell a system wether someone has been walking too much on constant elevation.

Possible solution

Randomizing the value might help but I guess that irrealistic altitude is not a good idea either. There are APIs that tells us realistic heights on latitude/longitude that consist in simple queries to return our desired data.

One candidate I've found is Mapzen Elevation API.

How it would help others

It's one less way to detect botting based on data sent to server.

@avexus
Copy link

avexus commented Aug 16, 2016

I didn't see a conf entry for altitude.
Is this info actually sent over to server?
It should be kept on GPS signal, right?

@Roekeye
Copy link

Roekeye commented Aug 16, 2016

It could use elevation information from a GPX file. A rout created from http://www.gpsies.com/ has elevation data in the export:

<trkseg>
  <trkpt lat="41.89118048" lon="-87.6108705">
    **<ele>190.00000</ele>**
  </trkpt>

@jboffel
Copy link

jboffel commented Aug 17, 2016

https://developers.google.com/maps/documentation/elevation/intro

The bot already require a google maps API key, then let's use the already available functions...

@k4n30
Copy link
Contributor

k4n30 commented Aug 17, 2016

#2762

@k4n30 k4n30 closed this as completed Aug 17, 2016
@jboffel
Copy link

jboffel commented Aug 17, 2016

I may suggest something like that in: PokemonGo-Bot\pokemongo_bot__init__.py

import googlemaps

class PokemonGoBot(object):
    @property
    def position(self):
        logger = logging.getLogger('AltitudeFaker')
        logger.setLevel(logging.INFO)
        # logger.info('Start to capture altitude for current location!')
        alt = 0
        if self.alt_cache.has_key((self.api._position_lat, self.api._position_lng)):
            alt = self.alt_cache[(self.api._position_lat, self.api._position_lng)]
        else:
            # logger.info('Not in cache yet')
            try:
                gmaps = googlemaps.Client(key=self.config.gmapkey)
                # logger.info('Got client')
                alt = gmaps.elevation((self.api._position_lat, self.api._position_lng))
                # logger.info('Got response')
                alt = alt[0]['elevation']
                # logger.info('Show response: {}'.format(alt))
                self.alt_cache[(self.api._position_lat, self.api._position_lng)] = alt
            except IOError as e:
                logger.info('Cannot get alt: %s' % e)
                alt = 0
        # logger.info('Current lng: {}, lat: {} then alt: {}'.format(self.api._position_lat, self.api._position_lng, alt))
        return self.api._position_lat, self.api._position_lng, alt
.....

I didn't take a close look at everything in the code but it was looking like a central place to retrieve current bot position to be used as input for most of the call.

But I guess there are some place in the code where the returned alt value was ignored and or overwritten eventually...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
@k4n30 @jboffel @gfreivasc @jrjhealey @Roekeye @avexus and others