92lleo / WhatsappWebToGo

[android] WhatsApp Web client for your phone/tablet with media support
https://f-droid.org/packages/io.kuenzler.whatsappwebtogo
MIT License
264 stars 43 forks source link

Remove "Download WhatsApp for Windows" by changing User agent string #118

Open littleboot opened 5 months ago

littleboot commented 5 months ago

The app works perfectly, better than all the adware crap available on the playstore.

The only downside is that the "Download WhatsApp for Windows" banner, I think I found a solution. By changing the user agent string to a OS that does not has a official whatsapp client the banner disappears.

I propose changing it to an OS that is unlikely to get a official whatsapp client, like Chromium OS (or linux). It seems to work I have tested it using Firefox and the addon User-Agent Switcher and Manager to check if the banner disappears.

image

As seen in the picture above it seems to work, using the following user agent string: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

It seems this can be easily changed by modifying the string constant in this file: WhatsappWebToGo/app/src/main/java/io/kuenzler/whatsappwebtogo/WebviewActivity.java https://github.com/92lleo/WhatsappWebToGo/blob/23dcaadb792ab589a76f5f8fb1d53a9b43dffeb3/app/src/main/java/io/kuenzler/whatsappwebtogo/WebviewActivity.java#L65

At the moment I do not have android studio installed so I cannot compile a APK and test it I hope someone can do this for me, I also have to check how this can be done I have not used android studio before. If it works please let me know, and if possible share the APK file.

92lleo commented 4 months ago

thanks for the hint, will check changing the user agent string needs to be handled with care. It also defines feature implementation toggles on whatsapp web side and makes detection of this in-app solution easier. But nevertheless it makes sense to look into it.