Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android 手机的 google maps 需要 某些地址 直连来让道路图和卫星图都显示为偏移的坐标。 #554

Closed
a8l1vy opened this issue Sep 4, 2017 · 5 comments

Comments

@a8l1vy
Copy link

a8l1vy commented Sep 4, 2017

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
Please read the instruction and answer the following questions before submitting your issue. Thank you.

  1. 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
    What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?
    2.34

  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.
    桌面版所有浏览器都用,手机版使用 google maps 导航。

  3. 你看到的不正常的现象是什么?
    What did you see?
    如果我在配置中写上www.google.com直连,hosts部分写上对应地址,不会生效。连的是其它google地址,连不上。

  4. 你期待看到的正确表现是怎样的?
    What's your expectation?
    配置中写上www.google.com直连,hosts部分写上对应地址,连接这个地址 就会 使用Hosts中的地址 直接连接。

  5. 请附上你的配置文件(提交 Issue 前请隐藏服务器端IP地址)。
    Please attach your configuration file (Mask IP addresses before submit this issue).

    Client Configuration File(客户端配置文件):
    只复制部分,太长。
    其中:
    "domainStrategy": "IPIfNonMatch",

rules部分

    // 在这里附上客户端配置文件
    // Please attach your client configuration file here.
			{
				"type": "field",
				"domain": ["google.com",
				"www.google.com",
				"clients4.google.com",
				"end00000000.com"],
				"outboundTag": "direct"
			},

dns中的部分:

    // 在这里附上客户端配置文件
    // Please attach your client configuration file here.
		"hosts": {
			"google.com": "x.x.x.x",
			"www.google.com": "x.x.x.x",
			"clients4.google.com": "x.x.x.x",
			"end000000000.com": "127.0.0.1"
		},
  1. 请附上出错时软件输出的日志。
    本地日志无错误。补充:才想起来日志记录是 warning ,我之后再看看有没有错误补发上来

1.1 起因:
手机端使用 代理,google地图应用中:
国内GPS点——我的位置(GCJ-02偏移坐标系),
道路图(GCJ-02偏移坐标系),
卫星图(WSG-84坐标系)。
道路图和卫星图是无法重合的,卫星图又是一个不得不用的功能。
国内偏僻的道路图缺失,还不如过期的卫星图好找地方。
(要不就是绘制人员凑合着绘制,明明一条弯曲的道路,图省事绘制成一条直线。)
(要不就是 在下面说的重合情况下,城市内 道路图和卫星图完全重合,偏僻的地方 道路图和卫星图完全不一样的很多。)

手机端使用 hosts 直连,google地图应用中:
国内GPS点——我的位置(GCJ-02偏移坐标系),
道路图(GCJ-02偏移坐标系),
卫星图(GCJ-02偏移坐标系)。
这样所有的图像都会重合,就可以用卫星图。

所以必须要让某些域名直连,并且指定IP地址。DNS 请求到的地址是连接不上的。
为什么我不用 hosts ,因为手机有支付,root 就不能用支付了。另一个手机上用 hosts.

1.2 过程:
(1)
PC 端共享一个移动热点 WIFI 。手机端关闭代理(未root未修改Hosts),连接 PC 端 WIFI 。用 Wireshark 记录手机请求的域名。
手机端一连接上就打开 google maps 。
附上记录的地址:

www.google.com
alt3-mtalk.google.com
id.google.com
apis.google.com
android.googleapis.com
www.googleadservices.com
lh4.googleusercontent.com
lh6.googleusercontent.com
lh5.googleusercontent.com

有上面这部分就可以打开 google maps 。至于哪个直连是 google 确定给你偏移卫星图,我不知道呀。因为配置文件连 www.google.com 都测试不成功。

后续部分是:

client1.google.com
connectivitycheck.gstatic.com
mtalk.google.com
android.clients.google.com
www.googleapis.com
personalsafety-pa.googleapis.com
lh3.googleusercontent.com
ad.doubleclick.net
android.googleapis.com
alt5-mtalk.google.com
www.gstatic.com
alt4-mtalk.google.com

(2)
取消所有代理设置,用上面记录的地址,写好 PC 端 hosts 文件,替换 PC 系统 hosts,
确定手机可以直接连接,并且可以打开地图画面,Hosts 中的 IP 地址就是有效的。
(重复好几次,因为开头的域名连不上,后续就没有某些域名的 DNS 请求)
再对 hosts 中的 www.google.com 测试,PC 端 IE 浏览器可以直连打开网页,IP 地址有效。
保存好记录,清空 PC 端 hosts 文件;
(3)
先在 v2ray 中写好配置文件,测试配置文件无错误,(配置如上面说的)
需要测试 PC 端 www.google.com 能不能 直连 打开。再说其它的。
打开 v2ray,PC 上的浏览器配置好代理端口,打开 www.google.com,连接不上,
防火墙连接窗口中,看到 v2ray 连接的并不是 v2ray 配置中给定的 IP 地址,而像是 DNS 请求得到的 google 地址。所以就连接不上。
(4)
手机端也测试过了, www.google.com 连不上。

1.3 结果:
就没有后续了。先用以前的过代理配置用呗。

@a8l1vy
Copy link
Author

a8l1vy commented Sep 22, 2017

现在电脑端已经配置改好了。可以直连 google ,并且搜索 my ip 显示为本地 ip 地址。
之前错误在("domainStrategy": "UseIP",) 之前没有使用此参数。

	{
		"tag": "direct",
		"protocol": "freedom",
		"settings": {
			"domainStrategy": "UseIP",
			"timeout": 0
		}
	},

手机端 Actinium 并没有按照配置文件描述直连打开 www.google.com (依然走了代理)。

@a8l1vy
Copy link
Author

a8l1vy commented Sep 29, 2017

这个可以关闭一下,地址不能直连不是 v2ray core 客户端的问题。手机端actinium存在的问题。
感谢作者创建一个实用的项目。

@hnliuzesen
Copy link

根 v2ray 没关系,跟你的 gsm.sim.operator.numeric 有关系,你 getprop gsm.sim.operator.numeric 看看你的是不是不是中国运营商的,所以没有自动纠偏。

@a8l1vy
Copy link
Author

a8l1vy commented Oct 22, 2017

不是的,手机有无sim卡都一样,有联通卡使用过。无sim卡连接wifi也使用过,一样的。
国内ip用hosts直接连接,卫星图、道路图、我的位置都是偏移后的。
用全局代理,卫星图为国际版无偏移,道路图、我的位置都是偏移的。
跟是不是内地ip连google有关系。
如果手机端可以测,就可以找出哪个域名内地ip直连,卫星图给偏移版的。

@ghost
Copy link

ghost commented Oct 28, 2017

Google Map 使用 clients4.google.com 来验证访问者的IP所在地,如从大陆来访就启用偏移接口。
(这个操作是一次性的,以后就不需要直连了,全走代理也没关系。)

Google 服务器又无法直连,所以你需要先设置代理规则 clients4.google.com>direct 直连;
另外,再找个能直连并且可以使用 Map 业务的 Google IP 添加到 hosts。

手机上记得先清理 Map 应用缓存。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants