• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Urgent please help

vikram001

Lurker
Urgent. Please help.

I want to block all text messages on my WhatsApp but I want to keep WhatsApp voice calls working.
How to do this?

Maybe WhatsApp text messages uses a specific server or port or server range or protocol that can be blocked system wide on my Android? Using something similar to Windows hosts file maybe?

Maybe the above text system is different from WhatsApp voice call servers/ports/protocols?

If correct then we can block WhatsApp messages servers/protocols/ports and leave voice calling intact & working.

Please help. Urgent.
 
'i don't think you can shut down one service and have the other one working. the only thing you can do is block people which would block texts but also phone calls as well.

just curious as to why you want to block only text messages from coming thru?
 
You could turn off sound/vibration/pop-ups for text messages so they don't disturb you while still ringing for calls.

I don't know whether WhatsApp uses different ports for these things, but even if it does I strongly suspect that root would be needed to block one of them: No Root Firewall doesn't have that level of control (from a quick perusal of its settings), and Android firewalls I've used that could do that required root.
 
Hi ocnbrze, thanks, I want to block the text but keep WhatsApp voip.

I think it's possible. I just saw a site that said WhatsApp voip is on port 5060 or 5064.

I could not figure out the WhatsApp voip servers. WhatsApp list of servers is too long.

I saw a firewall named no root firewall that allows custom filters based on app, servers, ports.

So if there's a lot of WhatsApp text chat servers & ports available then using this firewall these servers & ports can be blocked assuming they don't change the text servers.

I saw sites on whatsapp servers but could not understand which server/port combinations are for text chat on whatsapp.

I'm not a programmer so I can't understand this too well.

Link:

https://medium.com/@Gohulan/anatomy-of-whatsapp-messenger-60c876be4b14

https://www.quora.com/What-is-the-port-number-for-whatsapp

More info:

WhatsApp messenger uses the following ports: 5223, 5228, 4244, 5242, 443, 80 and 5222.

WhatsApp uses the XMPP protocol for its message delivery system.

For voip it uses ports 5060 & 5064.

How to block text & leave voip on?

No roots firewall can perhaps block it has provision for filtering ips & ports but how to make the custom filters?
 
Which second message? You've only made 2 posts, the first one was last edited 2.5 hours before I replied so contains no information I've not seen, and the others is this one I'm replying to.
 
Which second message? You've only made 2 posts, the first one was last edited 2.5 hours before I replied so contains no information I've not seen, and the others is this one I'm replying to.

OK you can't see it yet. Its status is "awaiting moderator approval", I guess that's because I posted some links in it on WhatsApp servers & ports.
 
If you go into your Settings >> Apps menu, find and open the WhatsApp app entry, and look in the Permissions menu, is there a 'SMS' option to enable/disable? That might disable texting overall but since WhatsApp's default is its own, proprietary texting protocol I don't know if that will apply just to SMS/MMS or all WhatsApp texting messages.
Also look in your Settings >> Apps menu and if there's a cog icon in the upper menubar there should be options to set default apps for different services (this will vary depending on your phone model and Android version). Try changing the texting option back to the default texting app.
 
Thanks Svim.. WhatsApp sms permission is already set to "off" & default sms service is some other app & not WhatsApp.

WhatsApp messaging system appears to be entirely different & completely Internet based.

I'm posting below some Google research on WhatsApp voip & texting.

Its a copy of what I posted before (minus the links) , it didn't go thru because of the links.

_____________________

Hi ocnbrze, thanks, I want to block the text but keep WhatsApp voip.

I think it's possible. I just saw a site that said WhatsApp voip is on port 5060 or 5064.

I could not figure out the WhatsApp voip servers. WhatsApp list of servers is too long.

I saw a firewall named no root firewall that allows custom filters based on app, servers, ports.

So if there's a lot of WhatsApp text chat servers & ports available then using this firewall these servers & ports can be blocked assuming they don't change the text servers.

I saw sites on whatsapp servers but could not understand which server/port combinations are for text chat on whatsapp.

I'm not a programmer so I can't understand this too well.

Links:

[REMOVED]


More info:

WhatsApp messenger uses the following ports: 5223, 5228, 4244, 5242, 443, 80 and 5222.

WhatsApp uses the XMPP protocol for its message delivery system.

For voip it uses ports 5060 & 5064.

How to block text & leave voip on?

No roots firewall can perhaps block it has provision for filtering ips & ports but how to make the custom filters?
 
WhatsApp can't actually work as your default SMS client. It only needs the SMS permission in order to read a verification SMS or to allow you to send invitations messages to people who do not have WhatsApp installed. So turning that permission off will not affect the reception of WhatsApp messages.

I've had a deeper look into No Root Firewall's features. In the "Global Filters" tab it has the option to set "pre-filters" (applied before the app filters) and "post-filters" (applied after app filters), and for these you can specify a port to be filtered. I don't see a lot of other detail there, just an address (defaulting to *, which conventionally is a wildcard character) and port number, so I guess you just list the ports you wish to block (and addresses if you have them).

Of course if anything else uses those ports you'll block that app too, unless you can specify the WhatsApp server address as well. A quick web search throws up other apps using at least some of those ports (I've not searched all), including for example the Play Store, so simply blocking all of those ports for all addresses is probably not a good idea.
 
Hadron thanks for that. Makes sense.

Do you know of an app that could tell me in real time what ports/servers are being used by which app?

It seems WhatsApp messaging uses a protocol called xmpp. Do you think noroots firewall or any other app can be used for blocking all xmpp communication?

Thanks for that - that system wide blocking based on port number is possible using a wildcard as url in no roots firewall. I will try this now.

WhatsApp messenger ports: 5223, 5228, 4244, 5242, 443, 80 and 5222.

I'll try wildcard url blocking of all abovementioned ports except 5228 (playstore) & 80 to see if that stops WhatsApp text.

WhatsApp voip uses ports 5060 & 5064 as per Google.

Will post results here.

If you (or anyone else) has more inputs please tell me.
 
Hadron I tried "Network Connections" as well as the built in "Access log" of noroots firewall.

It seems that WhatsApp is using only the following ports, often simultaneously, for both text & voip.
Does that make sense? Using the same ports for text & voip? Or am I missing something here?

443 : SSL port.
80: http port
5222 : Xmpp port.

I read previously that WhatsApp uses xmpp for text messages.

Google search shows.. :

"According to Extensible Messaging and Presence Protocol (Wikipedia), the standard TCP port for the server is 5222. The client would presumably use the same ports as the messaging protocol, but can also use http (port 80) and https (port 443) for message delivery."

What do you think I can try next?

Can the same ports be used for voip & text? Maybe xmpp is capable of doing both?
 
Given that the WhatsApp app and the WhatsApp service is much more than a common messaging service (along with being based on its own proprietary protocols), you're trying to individually manage its different aspects, something that would be easier on a desktop where you can have the ability to manage things like ports and selected processes on a more granular level, but more problematic with your typical Android install.
In your query you want to selectively allow/block specific ports but note that involves manipulating system-level resources. That would involve rooting your device, which also involves you to be aware of all the negatives that come with the positives with a rooted device -- one being just because you'll have the ability to change system-level processes that doesn't necessarily give you the knowledge to know what you're doing to your device once you do have access to things you typically can't mess around with. Anyway, by wanting to block specific ports you're not taking into account if WhatsApp is the only app/system service that also might use those ports. It's the Android operating system running on your device that manages the ports, not your apps, so by wanting to lock down a particular function in WhatsApp that might also result in other things to stop functioning that might typically rely upon -- i.e. port 80 is a very common port used for various http web services so if you did block it that will affect a lot of online access.
As for trying to use a non-root firewall app, keep in mind that you're installing the app as you, a general user. It cannot do something like block individual ports because again, those are managed at a system-level by the OS itself, not your apps. A no-root firewall will manage apps in general, but it will have only very limited-access to any system-level processes. Also as an aside, I'd strongly recommend you give some serious thought into migrated to a different firewall app. NoRoot Firewall appears to be an abandoned project with no updates since the end of 2014:
https://play.google.com/store/apps/details?id=app.greyshirts.firewall
NoRoot-abandoned.jpg
Simply because it has a large legacy isn't a very positive indicator. Networking and the Internet have continued to devolve numerous, hazardous ways since then so relying on an out-of-date product to 'protect' you is something that needs to be addressed. I'll tentatively suggest switching to NetGuard or Mobiwol, two also non-root firewall apps that have active development and support.

https://play.google.com/store/apps/details?id=eu.faircode.netguard

https://play.google.com/store/apps/details?id=com.netspark.firewall

There are of course any number of other viable options to choose from, those are just the two I've used and like.
 
Svim, what you say makes sense & yes I googled & read about Whatsapp using proprietory protocols.

I don't know how to root.

I tried the firewalls you mentioned but they do not offer port/url level control.

Noroots firewall OK it's old but does offer & successfully implement port/url level bans. Just like on the good old pc.

I created a filter with a *:* (url/port) ban and it worked. It blocked everything & the traffic piled up in the access logs under "denied".

I understand what you mean by different aspects of an integrated WhatsApp app, yes but all said & done can voip and text chat use the the same port? How can that be?

Both WhatsApp text & voip stall when I prevent WhatsApp from using port 80.

Well I'm about to abandon this...unless you want to give me more ideas on what to attempt?

Would a rooted phone be able to manage this you think?

The thing is if both text & voip are using the same ports (80, 443) then would a rooted phone be able to help?

Sounds like the WhatsApp app itself would need to be edited to disable text. (sounds bizarre I know)

If you think that's possible give me some ideas.

Other users please feel free to suggest too.

Thx
 
Well I'll just repeat what I failed to express previously, your wish to block specific ports will also disable online access for other, necessary for basic functionality. Again, it's the operating system that manages ports, not your apps. Also, WhatsApp being a multi-functional service, its app is also an integrated one involving those multiple services so, yeah, it would require a modification of the app itself on your device, or altering its source code and recompiling a new app, to selectively disable one particular feature. Keep in mind WhatsApp is not an Open Source project, nor is its app so even if you were to hire a developer to alter it to your liking it's not a legal venture.
If your primary goal is to eliminate text messaging but you want to continue WiFi calling it doesn't seem like using WhatsApp is the best option for you. There are plenty of text messaging apps and plenty of WiFi Calling and VoIP apps available. Plus a lot of text messaging apps are now including WiFi Calling functionality. Just as an example my preference the Signal Private Messenger app allows one to do WiFi Calling. And for voice and video calling there's Google's Duo app, available for both Android and iOS.
A primary appeal to WhatsApp is its own expansive messaging service but that's what you're trying to bypass, are there other reasons as to why you want to use Whatsapp for this matter?

And just to emphasize, regarding the NoRoot Firewall app, there are plenty of viable alternatives that are more current and have more expansive feature sets than NoRoot, an example being support for IPv6 TCP-UDP. Also NoRoot can only provide you with full functionality with WiFi but only partially with mobile data (cellular) because while other newer firewall apps support LTE, NoRoot does not.
As for the rooting issue, it was not a suggestion or recommendation but rather just reference because of the issue involving non-root firewall apps having only limited ability over lower-level system processes. A significant issue with root-required firewall apps and non-root ones is the difference their basic functionality. With root-required firewall apps, they have access to iptables, a well-developed, fundamental firewall that's an integrated service in the Linux kernel itself. So a root-required firewall app will just tie itself into iptables. But a non-root firewall app being installed by the user does not have any access to iptables. Most non-root firewall apps instead rely upon a clever work-around using a local VPN service. It's not a VPN that involves some remote servers in the cloud (i.e. a VPN service you pay to set up an account with) but rather one that runs solely on your device, so the filtering rules you set up get applied to the networking traffic as it gets looped back through this localized, internal VPN.
 
Back
Top Bottom