heiher / sockstun

A simple and lightweight VPN over socks5 proxy (tun2socks) for Android.
MIT License
213 stars 58 forks source link

Adapt to Android 12 (API level 31) #11

Closed mosentest closed 1 year ago

heiher commented 1 year ago

感谢你的PR,编译了这个版本并在Android 13(Arm64)系统上做了测试,初步发现了两个问题:

  1. Enable后程序崩溃了,VPN功能无法正常工作。
  2. Apps进入应用列表,只有部分应用可见。
mosentest commented 1 year ago

我没验证Android13.我明天处理下吧。我只是看了Android10

mosentest commented 1 year ago

不过我感觉不稳定啊,没在webview直接设置稳定,有的图片资源没办法请求成功,我不知道是不是网页的请求失败。还是什么原因

mosentest commented 1 year ago

我已经增加Android31 的应用列表获取权限了,我已经忘记是Android10引入的还是,11引入的。至于闪退问题,我手机没复现,能贴下日志吗

heiher commented 1 year ago

我已经增加Android31 的应用列表获取权限了,我已经忘记是Android10引入的还是,11引入的。至于闪退问题,我手机没复现,能贴下日志吗

06-29 23:48:47.676 25717 25717 E AndroidRuntime: java.lang.RuntimeException: Unable to start service hev.sockstun.TProxyService@62402f7 with Intent { act=hev.sockstun.CONNECT cmp=hev.sockstun/.TProxyService }: java.lang.IllegalArgumentException: hev.sockstun: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
06-29 23:48:47.676 25717 25717 E AndroidRuntime: Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
heiher commented 1 year ago

不过我感觉不稳定啊,没在webview直接设置稳定,有的图片资源没办法请求成功,我不知道是不是网页的请求失败。还是什么原因

什么不稳定?

mosentest commented 1 year ago

不过我感觉不稳定啊,没在webview直接设置稳定,有的图片资源没办法请求成功,我不知道是不是网页的请求失败。还是什么原因

什么不稳定?

我晚点录制个视频

mosentest commented 1 year ago

我已经增加Android31 的应用列表获取权限了,我已经忘记是Android10引入的还是,11引入的。至于闪退问题,我手机没复现,能贴下日志吗

06-29 23:48:47.676 25717 25717 E AndroidRuntime: java.lang.RuntimeException: Unable to start service hev.sockstun.TProxyService@62402f7 with Intent { act=hev.sockstun.CONNECT cmp=hev.sockstun/.TProxyService }: java.lang.IllegalArgumentException: hev.sockstun: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
06-29 23:48:47.676 25717 25717 E AndroidRuntime: Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

这个已修复了

heiher commented 1 year ago

还有一些代码风格不一致的情况,我改一下后合入。

heiher commented 1 year ago

Merged: https://github.com/heiher/sockstun/commit/6701cbee8d9692cee44fd477bf653b6fcd81e0f4

Thanks~

heiher commented 1 year ago

不过我感觉不稳定啊,没在webview直接设置稳定,有的图片资源没办法请求成功,我不知道是不是网页的请求失败。还是什么原因

什么不稳定?

我晚点录制个视频

如果是网络通过VPN后的访问性问题,我猜测可能是使用的Socks5服务器不支持UDP或是服务端不支持UDP relay over TCP但客户端选上了。建议配合 HevSocks5Server 测一下,它同时支持两种模式。

mosentest commented 1 year ago

不过我感觉不稳定啊,没在webview直接设置稳定,有的图片资源没办法请求成功,我不知道是不是网页的请求失败。还是什么原因

什么不稳定?

我晚点录制个视频

如果是网络通过VPN后的访问性问题,我猜测可能是使用的Socks5服务器不支持UDP或是服务端不支持UDP relay over TCP但客户端选上了。建议配合 HevSocks5Server 测一下,它同时支持两种模式。

我是购买别人的代理,这个没办法调整

heiher commented 1 year ago

自建吧