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

Deleted app appear two times in Wireguard "Advanced mode" #1656

Open iulko opened 2 months ago

iulko commented 2 months ago

Hello,

I had app X installed, I had it as only app added to my Advanced wiregaurd config, so that it would be only app proxied thru that wireguard.

Than witchout removing the app from the config, I uninstalled it and reinstalled again.

Now the app appears in wireguard advanced as app X. But when I press it, it also enables App "Unnamed (number)" Idk what is happening.

Edit: By installing, reinstalling, deleting configs, enable disabling etc in different ways, finally I got rid of the unnamed app in the list, propably sometimes table dont get flushed of deleted apps or something, idk how to reproduce the bug.

Maybe coz I had two apps with same name instaled but different package name installed at the same time? The "Unnamed" app appeared with both apps installed, or one of them or other one of them, seems like it was appearing if App name was present in the list not package name

ignoramous commented 2 months ago

seems like it was appearing if App name was present in the list not package name

Can you elaborate what you mean by this? Screenshots, if you have them?

I had two apps with same name installed but different package name installed at the same time

Could be.

sometimes table dont get flushed of deleted apps or something

Yes, the "flush" happens once every 3 hours or so. It isn't instant. So, this dual entry you saw shouldn't persist. If it did, then that's a bug. Alternatively, you can force Rethink to "flush" by tapping on the "Refresh" button in Configure -> Apps search bar at the top.

iulko commented 2 months ago

seems like it was appearing if App name was present in the list not package name

Can you elaborate what you mean by this? Screenshots, if you have them?

Sorry no screnshot anymore. I mean that bug persisted no matter if I had installed app android.app.id1 or android.app.id2 which both had names "App NAME", so seems like the bug was being executed by App Name instead of package id.

At the same time a app list in firewall never have had any bug and always showed both apps and no secret Unnamed app , is only the list in wireguard seems like have some kind of cache that stay after you delete an app.

sometimes table dont get flushed of deleted apps or something

Yes, the "flush" happens once every 3 hours or so. It isn't instant. So, this dual entry you saw shouldn't persist. If it did, then that's a bug. Alternatively, you can force Rethink to "flush" by tapping on the "Refresh" button in Configure -> Apps search bar at the top.

Thats the app list from the Firewall and not wireguard if im not mistaken, seems like it works differently, seems like its implementation from official Android app, coz looks similar.

ignoramous commented 2 months ago

seems like it works differently, seems like its implementation from official Android app, coz looks similar

Don't think we use official WireGuard app's impl for this... but you're right that there's a separate state that's kept around for apps shown for Advanced WireGuard. We'll take a look at the code once again to see if we spot anything & fix it, if so.

Thanks for this bug report. Let us know if you ever hit this bug again (you mentioned that you haven't is actually concerning...).

iulko commented 2 months ago

Thanks for this bug report. Let us know if you ever hit this bug again (you mentioned that you haven't is actually concerning...).

ahhh because I havent tried uninstalling the app after adding it to proxy again. Propably my 100 different things I did fixed it somehow so I decided to not try reproduce it to not have too much work again :)