tehp / OpenPoGoBot

A PokemonGo Python bot - NO LONGER MAINTAINED
MIT License
123 stars 53 forks source link

[Feature request] Mimic the request workflow of official application #356

Closed OursDesCavernes closed 3 years ago

OursDesCavernes commented 8 years ago

A friend of mine did some reverse on the phone app help implementing a more realistic client behavior: Client behavior by s0crat

Its worth reading.

niicojs commented 8 years ago

thanks, looks nice

niicojs commented 8 years ago

@wchill

niicojs commented 8 years ago

I did look at it a bit.

Basically when the game boot I can see GetPlayer(player_local_info, ?).CheclChallenge() and no response from server (???).

Then GetPlayer(player_local_info, ?).CheckChallenge() with server response.

Then DownloadRemoteConfigVersion(platform, app_version, ?).GetInventory().CheckAwardedBadges().DownloadSettings().CheckChallenge().GetHatchedEggs().

downloadsettings do answer with an hash that is important, as well as an minimum_client_version that is also important (and we should quit if this is not our API version).

Then app request for GetAssetDigest().GetInventory(last_timestamp).CheckChallenge().CheckAwardedBadges().DownloadSettings(previous hash).GetHatchedEggs().

Then the game indeed request from time to time GetMapObjects().CheckChallenge().CheckAwardedBadges().GetHatchedEggs().GetInventory(last timestamp).DownloadSettings(last hash)

I really did small test only, but it seems clicking on button (show player, show inventory...) do not generate call to server but display last info.

niicojs commented 8 years ago

Also, in DownloadRemoteConfigVersion there is field item_templates_timestamp_ms that seem to be the last update of download_item_templates, that should be used also.

niicojs commented 8 years ago

I just checked, if download_item_templates is recent, the app call: DownloadItemTemplates().GetHatchedEggs().CheckChallenge().GetInventory().CheckAwardedBadges().DownloadSettings() then the app cache the answer of DownloadItemTemplates along with the current timestamp.

niicojs commented 8 years ago

Ok, this branch is coming close to the real app: https://github.com/OpenPoGo/OpenPoGoBot/pull/360

MZorzy commented 8 years ago

new version coming, maybe new unknow6