-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
自定义hosts的功能 #2150
Comments
I think it's doable. What do you think? @Mygod |
BTW, setup a private DNS server can also solve your problem:
On Android 9, you can even setup a system-wide private DNS, (Both EMUI and MIUI support this) |
@madeye 主要问题在于直接暴露个dns server在公网上,安全攻击面太大。 |
Sounds like pain. I would set up a DNS forwarder on the remote and put "127.0.0.1:" in remote DNS instead. This should work since 4.7.1. |
@Mygod 背景在issue描述里也写了,用的ss是买的,因为线路很好能跑到10MB/s,自己的服务器只能50KB/s自己也买不起那么好线路的服务器。所以用了这个方案。如果能接触到ss服务端,确实可以有很多手段来解决这个问题。 |
Hmm, I think the problem here is the user is using a public shadowsocks server and a private FCM server. Yeah, it makes things complicated. Otherwise, a local DNS resolver running on the shadowsocks server is quite straightforward. |
In that case, please provide nice user interface instead of this hidden gotcha. Also I do not intend to include storage permission. I'm imagining using a hosts EditTextPreference as a global setting instead. Something like this would be nice: https://github.com/shadowsocks/v2ray-plugin-android/blob/70cc6094aba7fcef187282975bc44a511d0b24c5/app/src/main/java/com/github/shadowsocks/plugin/v2ray/CertificatePreferenceDialogFragment.kt |
抱歉,我对Android ui体系完全不熟悉。要求有ui才能合入,我还是fork吧。 |
这个功能十分有用,我之前为了研究 #2138 的具体问题时也改了个简单的版本出来。 |
Linux documents stuff using manual.
You can do the changes without UI and open a pull request that allows for modification. |
fine |
Have you tried system-wide |
@Mygod 我正文中有写
magisk就是替换 |
我知道这是一个已经存在的问题 #544 但3年前的实现和现在ss-android的实现有些不同。
我用的购买的ss服务,因此没有ss服务端的权限,ss服务端设了超时比较短,60秒没数据就断开连接,于是fcm就频繁的断开连接。我自己用golang写了一个fcm的中转代理,在国内和国外的vps上都搭了一个针对5228端口的转发,速度不快,但可以满足fcm push的稳定性需要。
以前是通过magisk的systemless hosts功能来修改hosts,把fcm涉及的多个域名全部指向我的服务器来提供服务的。
但更换了华为P20后,无法解锁也没有root能力,无法修改hosts,这条路走不通了。
看了现在的ss-android的方案,之前用的overture是可以指定hosts文件的但也是写死的,最新的用kotlin重写的dns server没有这个能力。
我想加入这个功能但不提供界面,通过targetApi>=19时尝试读取Context.getExternalFilesDir()下的hosts文件来提供这个能力(不存在或无权限则忽略),这样也不需要额外申请权限。
不知道做出这个功能后是否有可能合入?
The text was updated successfully, but these errors were encountered: