celzero / rethink-app

DNS over HTTPS / DNS over Tor / DNSCrypt client, WireGuard proxifier, firewall, and connection tracker for Android.
https://rethinkfirewall.com/
Apache License 2.0
3k stars 153 forks source link

v055m: Zombie WireGuards in Simple mode #1529

Open ignoramous opened 5 months ago

ignoramous commented 5 months ago

I have just realized that I can't delete WireGuard configs neither 1-by-1, nor by selecting all of them.

Also, they got pretty crazy here — configs started to select and deselect on their own (without me clicking anything). Also, it writes status "ACTIVE", while RethinkDNS in not enabled and is paused.

https://github.com/celzero/rethink-app/assets/100644/8f6d396e-b82b-4bfc-9e7b-3b6d86dc6d35

Originally posted by @soshial in https://github.com/celzero/rethink-app/issues/1524#issuecomment-2160042382

ignoramous commented 5 months ago

soshial, This issue seems concerning; Simple mode should not allow more than one WireGuard instance.

  • What happens when you click on the name of the WireGuard in Simple mode?
  • Is this the behavior you have observed from the start?
  • Can you fetch the adb logcat after setting Rethink to Very Verbose mode in Configure -> Settings -> Log Level?

https://github.com/celzero/rethink-app/issues/1524#issuecomment-2160480272

soshial commented 5 months ago

I've got an idea that those are not really running WireGuards, but maybe a RecyclerView problem? Can you check this idea first? Because this happens when RethinkDNS is OFF and it looks sooo much like the RecyclerView issue.

I'll check the logs a bit later.

ignoramous commented 5 months ago

Yeah, if you were always running in Advanced mode, then you should never be able to "view" Simple mode.

Likely the app crashed and then was left in this state when you re-opened it (you can see the app's current uptime in the footer of the bottomsheet that comes up when you tap on the downarrow next to the START / STOP button) where you can see Simple mode but the conifgs are running in Advanced mode.

But I'll check the logs

If you can capture logs starting from when you navigate to the screen and this happens, it'll help immensely. Make sure to put Rethink in Verbose mode from Configure -> Settings -> Log level.

soshial commented 5 months ago

Here are the logs. (Although I couldn't find anything from today) rethinkdns.bugreport.zip

Also, in the Advanced regime, one WG was ON for some reason. ![photo_5422573632460283142_y](https://github.com/celzero/rethink-app/assets/100644/9ae74919-efa0-4348-84f1-9113bce70905)
RethinkDNS is OFF. ![photo_5422573632460283140_y](https://github.com/celzero/rethink-app/assets/100644/d68d8cb3-f2b4-4da0-bf7b-2f4a6143a2a9)
soshial commented 5 months ago

Yeah, if you were always running in Advanced mode, then you should never be able to "view" Simple mode.

I never ran in Advanced mode. Always in the Simple mode.

Likely the app crashed and then was left in this state when you re-opened it.

Cannot check this anymore, unfortunately: when I saw this weird bug, I force-stopped the app myself to see whether this remove the issue, but it did not.

hussainmohd-a commented 5 months ago

Can you start the Rethink app and click on the Refresh icon on the Proxy screen to see if there are any changes? Also, please send us the bug report after the refresh is complete.

soshial commented 5 months ago

I clicked the refresh icon (here are the logs rethinkdns.bugreport(1).zip) and now it doesn't allow me to select WireGuard configs anymore... Weird.

screenshot ![photo_5422573632460283186_y](https://github.com/celzero/rethink-app/assets/100644/c5b0788e-84c9-41a5-bba7-3204a3eecdf8)
hussainmohd-a commented 5 months ago

@soshial, are you now unable to select the wireguard config when Rethink is active?

soshial commented 5 months ago

I was unable to select any config when Rethink was disabled (not active). It just showed this toast text when I clicked on the checkbox. But after some time it resolved by itself and I was able to open and activate configs.

You said that it's impossible to activate several configs in the "Simple regime", so only a single config possibel to activate — then I am wondering why do list elements have checkboxes instead of radio elements?

ignoramous commented 5 months ago

You said that it's impossible to activate several configs in the "Simple regime",

Impossible is nothing. There are always bugs, some impossible to rectify ;)

so only a single config possibel to activate — then I am wondering why do list elements have checkboxes instead of radio elements?

Mostly for the tick mark ✔️