forked from RealDeviceMap/RealDeviceMap-UIControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spoof.py
44 lines (32 loc) · 955 Bytes
/
spoof.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import subprocess
import time
import requests
import os
# Only use this for iSpoofer not for PokemonGo++
# EDIT ME
device_id = 'DEVICE_UUID'
location_url = 'http://DEVICE_IP:8080/loc'
# DON'T EDIT ME
FNULL = open(os.devnull, 'w')
while True:
try:
r = requests.get(location_url)
result = r.json()
lat = result['latitude']
lon = result['longitude']
if lat < 0:
lat_str = '-- {}'.format(lat)
else:
lat_str = str(lat)
if lon < 0:
lon_str = '-- {}'.format(lon)
else:
lon_str = str(lon)
process = subprocess.Popen('idevicelocation -u {} {} {}'.format(device_id, lat_str, lon_str), shell=True,
stdout=FNULL, stderr=FNULL)
print 'Teleporting to {},{}'.format(lat,lon)
process.wait()
time.sleep(0.1)
except:
print 'Failed to teleport'
time.sleep(1)