Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Add device info to requests #108

Merged
merged 1 commit into from
Aug 19, 2016
Merged

Add device info to requests #108

merged 1 commit into from
Aug 19, 2016

Conversation

wchill
Copy link
Contributor

@wchill wchill commented Aug 18, 2016

Currently a blank device info is sent. This adds support for passing in your own device info.
Also persists session_hash to last between requests.

Example usage:

device_info = {}
device_info['device_id'] = "0123456789abcdef0123456789abcdef"
device_info['device_brand'] = "Apple"
device_info['device_model'] = "iPhone"
device_info['device_model_boot'] = "iPhone8,2"
device_info['hardware_manufacturer'] = "Apple"
device_info['hardware_model'] = "N66AP"
device_info['firmware_brand'] = "iPhone OS"
device_info['firmware_type'] = "9.3.3"

api = PGoApi(provider="google", username="wchill", password="password", position_lat=0.0, position_lng=0.0, position_alt=0.0, device_info=device_info)

@keyphact
Copy link
Member

👍

@keyphact keyphact merged commit 36c6364 into master Aug 19, 2016
@ghost
Copy link

ghost commented Aug 19, 2016

Would it be possible to generate a random a device_id with https://docs.python.org/3/library/uuid.html?

@peterbaumert
Copy link

Sadly this raises an attribute error here, is there anything else to change?

@Noctem
Copy link
Contributor

Noctem commented Aug 19, 2016

@imapokemon4 Yeah.

import uuid
device_id = uuid.uuid4().hex

@ghost
Copy link

ghost commented Aug 19, 2016

@Noctem does the other device info matter?

@Noctem
Copy link
Contributor

Noctem commented Aug 19, 2016

@imapokemon4 Presumably, yes. If you're going to go to the trouble of generating a UUID, you might as well provide the rest of the information. We don't really know what they will and won't check on their end.

@ghost
Copy link

ghost commented Aug 19, 2016

@Noctem I think what I meant ask was: Does the other device info need to correspond at all to the generated UUID?

@peterbaumert
Copy link

@imapokemon4 still getting File "/poke/scanner/pgoapi/pgoapi.py", line 223, in call
request = RpcApi(self._auth_provider, self.device_info)
File "/poke/scanner/pgoapi/pgoapi.py", line 314, in getattr
raise AttributeError

@Noctem
Copy link
Contributor

Noctem commented Aug 19, 2016

@imapokemon4 Oh, no. It should just be random, unless there's a difference in lengths between iOS and Android or something. But at least on iOS it's just 32 hexadecimal digits.

@ghost
Copy link

ghost commented Aug 19, 2016

@peterbaumert You're getting that error while trying to use a randomly generated UUID?

@ghost
Copy link

ghost commented Aug 19, 2016

@peterbaumert I haven't actually tried it yet myself.

@peterbaumert
Copy link

peterbaumert commented Aug 19, 2016

Im getting this error no matter what device info I use :D
It occurs every time on get_map_objects.

@peterbaumert
Copy link

Or did get_map_objects arguments change also and I'm missing some?
I use api.get_map_objects(latitude=position[0], longitude=position[1], since_timestamp_ms=timestamps, cell_id=cell_ids)

@Noctem
Copy link
Contributor

Noctem commented Aug 19, 2016

@peterbaumert I believe #109 fixes that attribute error.

@peterbaumert
Copy link

@Noctem perfect thank you so much, will try later when i got time

@trippyhat
Copy link

Does the device_id have to be a certain length or pattern?

@trippyhat
Copy link

@Noctem I'm getting the AttributeError as well and I'm running the latest code on master (commit e4f1c9a). It happens on get_map_objects() request.

Here is what I have:

        device_info['device_id'] = uuid.uuid4().hex
        device_info['device_brand'] = "Apple"
        device_info['device_model'] = "iPhone"
        device_info['device_model_boot'] = "iPhone8,2"
        device_info['hardware_manufacturer'] = "Apple"
        device_info['hardware_model'] = "N66AP"
        device_info['firmware_brand'] = "iPhone OS"
        device_info['firmware_type'] = "9.3.3"

        self.api = pgoapi.PGoApi(device_info=device_info)

@peterbaumert
Copy link

@trippyhat the pr #109 from @Noctem isn't merged yet so you need to do that manually.

@trippyhat
Copy link

@peterbaumert Thanks, I added in #109 and it's working now!

@trippyhat
Copy link

Is the device_id the IMEI, ICCID, or MEID?

@dnsBlah
Copy link

dnsBlah commented Aug 19, 2016

UUID is nothing related with your SIM or Carrier...

@wchill wchill deleted the device-id branch August 19, 2016 16:19
surewhynotmon referenced this pull request in PokemonGoF/PokemonGo-Bot Aug 19, 2016
* Start to use the signature interface.

* Added dummy class to show how to use:
DeviceInfo
ActivityStatus
SensorInfo

* sensor data is randomly generated (#4249)

* including activity status details resulted in uk6 fail (no map objects), need more iOS dumps to identify the issue

* Switch the upstream of pgoapi to joelgreen, he will handle the upupstream PR as well.
@pogodevorg pogodevorg locked and limited conversation to collaborators Aug 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants