Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ iOSRealRun-cli
- 查看自己的 iOS 版本,下载对应的 `DeveloperDiskImage.dmg` 和 `DeveloperDiskImage.dmg.signature` 文件
- 进入脚本目录 `DeveloperDiskImage` 文件夹中建立以版本号为名称的文件夹,将刚才下载的两个文件放入此文件夹。
例如,你是 15.1 版本的系统,你需要下载并解压 `DeveloperDiskImage.dmg` 和 `DeveloperDiskImage.dmg.signature` 文件,把他们放到 `DeveloperDiskImage/15.1` 里面
4. 接下来和 [iOSFakeRun](https://github.com/Mythologyli/iOSFakeRun) 一样要获取你要的跑步路径,格式和其使用的格式完全相同,**但是请只画一圈**,项目预置了一个画的不太行的海宁操场路径,建议所有人都自己画路径
4. 接下来和 [iOSFakeRun](https://github.com/Mythologyli/iOSFakeRun) 一样要获取你要的跑步路径,格式和其使用的格式完全相同,**但是请只画一圈**,项目预置了一个画的不太行的紫金港操场路径,建议所有人都自己画路径
> 打开[路径拾取网站](https://fakerun.myth.cx/)。通过点击地图构造路径。点击时无需考虑间距,会自动用直线连接。路径点击完成后,单击上方的路径坐标——复制,将坐标数据复制到剪贴板
5. 打开脚本目录里的 `route.txt` 文件,将刚复制的文件原封不动的粘贴进去,保存并退出
6. 对于 Windows,你需要安装 iTunes,以确保驱动正常运行
Expand Down
Empty file modified libimobiledevice/darwin/idevicedevmodectl
100644 → 100755
Empty file.
Empty file modified libimobiledevice/darwin/ideviceimagemounter
100644 → 100755
Empty file.
Empty file modified libimobiledevice/darwin/ideviceinfo
100644 → 100755
Empty file.
Empty file modified libimobiledevice/darwin/idevicepair
100644 → 100755
Empty file.
Empty file modified libimobiledevice/darwin/idevicesetlocation
100644 → 100755
Empty file.
Empty file modified libimobiledevice/darwin/libimobiledevice-1.0.6.dylib
100644 → 100755
Empty file.
Empty file modified libimobiledevice/darwin/libimobiledevice-glue-1.0.0.dylib
100644 → 100755
Empty file.
Empty file modified libimobiledevice/darwin/libplist-2.0.3.dylib
100644 → 100755
Empty file.
Empty file modified libimobiledevice/darwin/libusbmuxd-2.0.6.dylib
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/idevicedevmodectl.exe
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/ideviceimagemounter.exe
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/ideviceinfo.exe
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/idevicepair.exe
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/idevicesetlocation.exe
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/libcrypto-3-x64.dll
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/libimobiledevice-1.0.dll
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/libimobiledevice-glue-1.0.dll
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/libplist++-2.0.dll
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/libplist-2.0.dll
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/libssl-3-x64.dll
100644 → 100755
Empty file.
Empty file modified libimobiledevice/win/libusbmuxd-2.0.dll
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
PyYAML==6.0
geopy==2.4.1
PyYAML==6.0.1
2 changes: 1 addition & 1 deletion route.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"lng":"120.7335575167566","lat":"30.52802386594508"},{"lng":"120.7335664998117","lat":"30.527949984828833"},{"lng":"120.73357997439435","lat":"30.527887769107984"},{"lng":"120.73361590661474","lat":"30.527825553346897"},{"lng":"120.7336653134178","lat":"30.527771114522935"},{"lng":"120.73372370327594","lat":"30.527720564158813"},{"lng":"120.73379107618919","lat":"30.527689456229226"},{"lng":"120.73387641521265","lat":"30.527662236782586"},{"lng":"120.73397073729119","lat":"30.52765057130309"},{"lng":"120.73407404242484","lat":"30.527646682809618"},{"lng":"120.73416387297584","lat":"30.527677790753035"},{"lng":"120.73428514421968","lat":"30.52773611811983"},{"lng":"120.73436150018803","lat":"30.52781388788721"},{"lng":"120.73441539851864","lat":"30.527922765455916"},{"lng":"120.73444234768392","lat":"30.52803941985705"},{"lng":"120.73445133073903","lat":"30.528156074116726"},{"lng":"120.73445582226658","lat":"30.5283038359759"},{"lng":"120.73446031379413","lat":"30.528420489914918"},{"lng":"120.73446031379413","lat":"30.52852158988096"},{"lng":"120.73446480532168","lat":"30.528618801286576"},{"lng":"120.73446480532168","lat":"30.528719901044198"},{"lng":"120.73445582226658","lat":"30.52881322380307"},{"lng":"120.73442887310128","lat":"30.528902658028688"},{"lng":"120.73439294088088","lat":"30.52898820373192"},{"lng":"120.73434353407784","lat":"30.529034864992525"},{"lng":"120.73427616116459","lat":"30.529081526230495"},{"lng":"120.73420429672379","lat":"30.52912429901208"},{"lng":"120.73414590686563","lat":"30.529143741179244"},{"lng":"120.73408302547993","lat":"30.52915929491014"},{"lng":"120.73399319492894","lat":"30.52915540647765"},{"lng":"120.73390785590549","lat":"30.52915540647765"},{"lng":"120.73383599146469","lat":"30.529135964312847"},{"lng":"120.733773110079","lat":"30.529108745275526"},{"lng":"120.73372370327594","lat":"30.529065972487018"},{"lng":"120.73365633036269","lat":"30.529003757487974"},{"lng":"120.73361590661474","lat":"30.528925988682573"},{"lng":"120.7335754828668","lat":"30.528855996703964"},{"lng":"120.7335664998117","lat":"30.528782116226836"},{"lng":"120.7335575167566","lat":"30.528719901044198"},{"lng":"120.7335575167566","lat":"30.52863435510235"},{"lng":"120.7335575167566","lat":"30.528541032169947"},{"lng":"120.7335575167566","lat":"30.528451597608097"},{"lng":"120.7335485337015","lat":"30.528350497568482"},{"lng":"120.73355302522906","lat":"30.528261062829475"},{"lng":"120.7335575167566","lat":"30.52818329342363"},{"lng":"120.73356200828415","lat":"30.528128854802127"}
{"lng":"120.08845086732593","lat":"30.310177948123332"},{"lng":"120.08860357926262","lat":"30.310158461840157"},{"lng":"120.08868891828608","lat":"30.31021302342319"},{"lng":"120.08881917258502","lat":"30.310290968488587"},{"lng":"120.08888205397072","lat":"30.31042737220237"},{"lng":"120.08890002008091","lat":"30.310602748124037"},{"lng":"120.08886408786051","lat":"30.310836582193172"},{"lng":"120.08881468105747","lat":"30.31100806015239"},{"lng":"120.08875629119932","lat":"30.31120292110182"},{"lng":"120.08874281661667","lat":"30.311393884452592"},{"lng":"120.08867095217587","lat":"30.311588744627155"},{"lng":"120.08857663009732","lat":"30.311717352128007"},{"lng":"120.08844188427084","lat":"30.31176411844969"},{"lng":"120.08827120622394","lat":"30.31177191283444"},{"lng":"120.08816340956274","lat":"30.311725146516526"},{"lng":"120.08802866373624","lat":"30.311678380176055"},{"lng":"120.0879163755475","lat":"30.311588744627155"},{"lng":"120.0879163755475","lat":"30.311452342546055"},{"lng":"120.08793883318525","lat":"30.311292557007146"},{"lng":"120.0879433247128","lat":"30.311113285113688"},{"lng":"120.0879792569332","lat":"30.31089114339489"},{"lng":"120.08805561290154","lat":"30.310626131556315"},{"lng":"120.08810951123213","lat":"30.310329940997807"},{"lng":"120.08819934178314","lat":"30.310201331657986"},{"lng":"120.08832959608209","lat":"30.31018574263551"}
62 changes: 51 additions & 11 deletions tools/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,58 @@
run.py
automatically run the route
"""

"""修正坐标误差,百度取点使用 BD-09 坐标系,iOS使用 WGS-09 坐标系,进行转换"""
def bd09Towgs84(position):
import math
wgs_p = {}

x_pi = 3.14159265358979324 * 3000.0 / 180.0
pi = 3.141592653589793238462643383 # π
a = 6378245.0 # 长半轴
ee = 0.00669342162296594323 # 偏心率平方

def transform_lat(x, y):
ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * math.sqrt(abs(x))
ret += (20.0 * math.sin(6.0 * x * pi) + 20.0 * math.sin(2.0 * x * pi)) * 2.0 / 3.0
ret += (20.0 * math.sin(y * pi) + 40.0 * math.sin(y / 3.0 * pi)) * 2.0 / 3.0
ret += (160.0 * math.sin(y / 12.0 * pi) + 320 * math.sin(y * pi / 30.0)) * 2.0 / 3.0
return ret

def transform_lon(x, y):
ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * math.sqrt(abs(x))
ret += (20.0 * math.sin(6.0 * x * pi) + 20.0 * math.sin(2.0 * x * pi)) * 2.0 / 3.0
ret += (20.0 * math.sin(x * pi) + 40.0 * math.sin(x / 3.0 * pi)) * 2.0 / 3.0
ret += (150.0 * math.sin(x / 12.0 * pi) + 300.0 * math.sin(x / 30.0 * pi)) * 2.0 / 3.0
return ret

x = position['lng'] - 0.0065
y = position['lat'] - 0.006
z = math.sqrt(x * x + y * y) - 0.00002 * math.sin(y * x_pi)
theta = math.atan2(y, x) - 0.000003 * math.cos(x * x_pi)

gcj_lng = z * math.cos(theta)
gcj_lat = z * math.sin(theta)

d_lat = transform_lat(gcj_lng - 105.0, gcj_lat - 35.0)
d_lng = transform_lon(gcj_lng - 105.0, gcj_lat - 35.0)

rad_lat = gcj_lat / 180.0 * pi
magic = math.sin(rad_lat)
magic = 1 - ee * magic * magic
sqrt_magic = math.sqrt(magic)

d_lng = (d_lng * 180.0) / (a / sqrt_magic * math.cos(rad_lat) * pi)
d_lat = (d_lat * 180.0) / (a * (1 - ee) / (magic * sqrt_magic) * pi)

wgs_p["lat"] = gcj_lat * 2 - gcj_lat - d_lat
wgs_p["lng"] = gcj_lng * 2 - gcj_lng - d_lng
return wgs_p

# get the ditance according to the latitude and longitude
def geodistance(p1, p2):
lat1, lng1 = p1["lat"], p1["lng"]
lat2, lng2 = p2["lat"], p2["lng"]
from math import radians, cos, sin, asin, sqrt
lng1, lat1, lng2, lat2 = map(radians, [float(lng1), float(lat1), float(lng2), float(lat2)]) # 经纬度转换成弧度
dlon=lng2-lng1
dlat=lat2-lat1
a=sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
distance=2*asin(sqrt(a))*6371*1000 # 地球平均半径,6371km
return distance
from geopy.distance import geodesic
return geodesic((p1["lat"],p1["lng"]),(p2["lat"],p2["lng"])).m

def smooth(start, end, i):
import math
Expand Down Expand Up @@ -97,13 +138,12 @@ def run1(loc: list, v, dt=0.2):
fixedLoc = randLoc(fixedLoc, n=n) # a path will be divided into n parts for random route
clock = time.time()
for i in fixedLoc:
utils.setLoc(i)
utils.setLoc(bd09Towgs84(i))
while time.time()-clock < dt:
pass
clock = time.time()

def run(loc: list, v, d=15):
import tools.utils as utils
import random
import time
random.seed(time.time())
Expand Down
2 changes: 1 addition & 1 deletion tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def getDeviceInfo():


def setLoc(loc):
cmd(["idevicesetlocation", "--", str(loc["lat"]-0.00389), str(loc["lng"]-0.01075)], False)
cmd(["idevicesetlocation", "--", str(loc["lat"]), str(loc["lng"])], False)

def resetLoc():
cmd(["idevicesetlocation", "reset"], False)
Expand Down