Pokemon GO has finally launched in Japan: tada:
Overseas [Reverse engineering] pokemongo-android-re, [Kneading the internal API] pokemongo-map, Seems to be playing
Perhaps because of that, GitHub has a repository related to Pokemon GO.
... I have no choice but to play around with it!
Alright ** Make a Twitter bot that mutters Pokemon caught in Pokemon GO: exclamation :: exclamation: **
I made it with my thoughts
** Please try at your own risk **
3846masa/Tweet-PokemonGO-Journal
I'll put the code I wrote on GitHub
https://github.com/3846masa/Tweet-PokemonGO-Journal
When you move it, it looks like this
https://twitter.com/EBAGmasa_pokego
tejado/pgoapi
There were various library-like things that could hit the API, Somehow I chose [tejado / pgoapi]
Even Dockerfile is prepared, so you can play easily
When you catch a Pokemon, it will be recorded in the Bouken Note (English name: Journal). In other words, it seems that you only need to get the data of the Boken notebook **
Unfortunately there was no Journal example in tejado / pgoapi
When I searched for a function, I found [pgoapi.py # L107-L127].
def __getattr__(self, func):
def function(**kwargs):
if not self._req_method_list:
self.log.info('Create new request...')
name = func.upper()
if kwargs:
self._req_method_list.append( { RequestType.Value(name): kwargs } )
self.log.info("Adding '%s' to RPC request including arguments", name)
self.log.debug("Arguments of '%s': \n\r%s", name, kwargs)
else:
self._req_method_list.append( RequestType.Value(name) )
self.log.info("Adding '%s' to RPC request", name)
return self
if func.upper() in RequestType.keys():
return function
else:
raise AttributeError
If you follow RequestType.Value
,
You will reach [AeonLucid / POGOProtos --RequestType.proto]
Pokemon GO communication seems to use Protocol Buffers
Let's capture a packet to see what kind of data is actually flowing
For Android packet capture, refer to [here] android-packet
When I captured it, it looked like this
Looking at it somehow, I'm curious about the number 801
.
If you search by [AeonLucid / POGOProtos --RequestType.proto],
It seems to be SFIDA_ACTION_LOG
If you compare it with the code of tejado / pgoapi,
I think I can get something with ʻapi.sfida_action_log ()
`
(By the way, POGOProtos in tejado / pgoapi at the moment is old, so let's replace it.)
api.sfida_action_log()
The execution result looks like this
{
'api_url': ...,
'auth_ticket': { ... },
'request_id': ...,
'responses': {
'SFIDA_ACTION_LOG': {
'log_entries': [{
'catch_pokemon': {
'combat_points': 156,
'pokemon_id': 114,
'result': 1
},
'timestamp_ms': 1469169999498
}, {
'fort_search': {
'items': [{
'count': 3,
'item_id': 1
}],
'result': 1
},
'timestamp_ms': 1469233607913
}],
'result': 1
}
},
'status_code': 2
}
Probably fort_search
is the pocket stop information,
catch_pokemon
is probably the captured Pokemon information
All you have to do is make a Twitter bot with Zackri: muscle:
These private APIs have a strong impression of tampering with the game, I feel like I can do something interesting in the area of logging.
Of course, ** Don't put a load on the server: no_entry_sign: But ** Isn't it better to just play around with it?
Recommended Posts