zaneschepke / wgtunnel

An alternative Android client app for WireGuard VPN
https://zaneschepke.com/wgtunnel-docs
MIT License
634 stars 34 forks source link

[BUG] - Connection button is flipping on and off continously when entering an untrusted WiFi #145

Closed kafisc1 closed 3 months ago

kafisc1 commented 4 months ago

Describe the bug Auto-tunneling is activated. When conencting an untrusted Wifi (LTE to untrusted Wifi) sometimes the connection button is flipping on and off continously till the smartphone becomes unresponsive.

Smartphone (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Enter an untrusted Wifi with activated Auto-tunneling
  2. The connection button is flipping on and off very fast

Expected behavior Conenction should be established

Screenshots (Only if necessary)

Additional context Add any other context about the problem here.

001 002

I was able to screencapture the behavior: https://github.com/zaneschepke/wgtunnel/assets/56489749/998c2444-f42f-4fe7-9304-c1881057e372

zaneschepke commented 4 months ago

Hello! A few questions:

  1. Do you have a multi peer config or just one peer?
  2. Does this only occur with the restart on ping fail feature active or have you seen this behavior without that feature?
kafisc1 commented 4 months ago

Hello! A few questions:

  1. Do you have a multi peer config or just one peer?
  2. Does this only occur with the restart on ping fail feature active or have you seen this behavior without that feature?

Thank's for your reply.

  1. Just one peer.
  2. It does occur with the "restart on ping fail feature" disabled. I've had this issue on older versions also.
kafisc1 commented 4 months ago

After the issue occured again I was able to generate some logs (adb logcat):

`03-22 11:29:40.037 11572 5581 V WireGuard/RootShell: executing: wg-quick down '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:40.410 11572 5581 V WireGuard/RootShell: executing: cat /sys/module/wireguard/version && wg-quick up '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:40.941 11572 5548 V WireGuard/RootShell: executing: wg-quick down '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:41.311 11572 5548 V WireGuard/RootShell: executing: cat /sys/module/wireguard/version && wg-quick up '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:41.866 11572 5542 V WireGuard/RootShell: executing: wg-quick down '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:42.268 11572 5542 V WireGuard/RootShell: executing: cat /sys/module/wireguard/version && wg-quick up '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:42.781 11572 5587 V WireGuard/RootShell: executing: wg-quick down '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:43.121 11572 5587 V WireGuard/RootShell: executing: cat /sys/module/wireguard/version && wg-quick up '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:43.711 11572 5598 V WireGuard/RootShell: executing: wg-quick down '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:44.095 11572 5598 V WireGuard/RootShell: executing: cat /sys/module/wireguard/version && wg-quick up '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:44.704 11572 5597 V WireGuard/RootShell: executing: wg-quick down '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:45.025 11572 5597 V WireGuard/RootShell: executing: cat /sys/module/wireguard/version && wg-quick up '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:45.623 11572 5598 V WireGuard/RootShell: executing: wg-quick down '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:46.032 11572 5598 V WireGuard/RootShell: executing: cat /sys/module/wireguard/version && wg-quick up '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:46.677 11572 5577 V WireGuard/RootShell: executing: wg-quick down '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:47.042 11572 5577 V WireGuard/RootShell: executing: cat /sys/module/wireguard/version && wg-quick up '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:47.608 11572 5598 V WireGuard/RootShell: executing: wg-quick down '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' 03-22 11:29:47.942 11572 5598 V WireGuard/RootShell: executing: cat /sys/module/wireguard/version && wg-quick up '/data/user/0/com.zaneschepke.wireguardautotunnel/cache/tmp/Kai_P7.conf' I've cuttet the logs here. This goes on and on.

I will try to generate some WG Tunnel logs from within the app.

kafisc1 commented 4 months ago

I can't create logs from within the app because the app crashes before I can generate the logs.

But I can reproduce the issue following way:

Set "Auto-tunneling" to Pause and connect to wireguard profile manually. Wait till the conenction is established.

Click on the connection button 2 times per second for about 4 seconds. After 4-6 clicks on the connection button the issue occurs. In the attached video the issue occurs after 10 seconds going onward. Crash WG Tunnel

https://github.com/zaneschepke/wgtunnel/assets/56489749/4c0cf240-a4dd-4d89-8793-250c26304e5a

I was able to create crash logs: wgtunnel-logs-1711113441.txt wgtunnel-logs-1711113542.txt wgtunnel-logs-1711113546.txt