Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
littleboot opened this issue Feb 1, 2024 · 2 comments
Open

Comments

@littleboot
Copy link

littleboot commented Feb 1, 2024

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

private static final String CHROME_FULL = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36";

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
Copy link
Owner

92lleo commented Feb 22, 2024

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.

@voidplayer
Copy link

voidplayer commented Aug 29, 2024

There was a banner that wasnt showing for me under the chat list until today when i tried it on a new phone, but is the same banner "donwload app for windows"

I think is easier to just remove it via css than to change agents :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants