pythech's Blog

Not a hacker blog

WhatsApp Group Subject Max Character Limit Bypass

Few days ago WhatsApp pushed a new update to those who have iOS devices, the most substantial one is perhaps the redesigned UI, which looks better than before if you ask me. If you have noticed, group titles are now aligned to the left, rather then centre, again a good looking change. However the ridiculous 25 character limit for the subject length became more apparent now, there is just too much space and frankly, it feels bad not to be able to utilize all of that. Here’s how to fix it.

Background

I was challenged by a friend of mine to write a WhatsApp bot a few months ago, which is probably illegal, but trust me all it did was posting a few selected high quality dank memes™. The bot was a greasemonkey script which hooked web.whatsapp.com, cool. Automating the Whatsapp UI was a little more than glitchy than I expected, but it worked so ¯\_(ツ)_/¯. Though, it didn’t seem like a good idea after I was done with it and in the end we had to shut it down (using too much bandwith and all that, it wasn’t practical).

Fast-forward a few months I tried to do the same thing this time on the jailbroken iPhone itself. While poking around the code though I have discovered that WhatsApp’s real character limit for group title is actually … 35? If you don’t already know WhatsApp normally restricts titles to 25 characters, while its servers handle 35 characters… just fine.

I don’t know what happened at the WhatsApp’s end but I’d imagine WhatsApp originally had 35 character limit and then they decided that it was too long and reduced to 25. Limiting it by the client-side is totally enough I guess. And instead of truncating the older subjects they wanted backwards compatability or just simply forgot about it.

Bypass using Whatsapp Web

Well there is a few way to do is but probably the most easier one is using web.whatsapp.com. After logging in, go to the group info, right click to the subject name and just Inspect Element ¯\_(ツ)_/¯. Well I think that’s enough for a lot of folks but if you need help here are some more steps:

  • Click Edit Text
  • Enter your new subject title
  • Since the javascript event for input change wasn’t triggered you should mutate the subject using normal ways, like adding a dummy character and deleting it, whatever works best.

And you’re done. If you want to be fancy you can also type

1
$('.input-text').onkeypress = function(e) { e.stopPropagation(); }

into your browser’s console to stop WhatsApp from sanitizing your input.

Note that you have to paste this code after you open the Group Info panel (which is used to change the subject title, duh). Also you don’t have to count character bytes for this one, every unicode character is counted as 1.

Bypass using Theos

Another possibility is that using Theos to make a tweak to change the max subject length on the device itself. It’s an easy one too, you only have to hook one function as below:

1
2
3
4
5
6
%hook WAServerProperties
+(NSInteger) maxGroupSubjectLength
{
  return 35; // it's really 35, trust me
}
%end

Obviously you can use Flex or FLEXible for this task since it’s too easy.

By the way, you might ask what if I increase the limit to something higher than 35, well this is what happens:

Update

The bypass methods I published for WhatsApp Web no longer work as of November 2017. No need to worry though, I’ve come up with a far easier method.

When you open web.whatsapp.com for the first time, open the browser console and paste this:

1
Store.ServerProps.maxSubject = 35

From now on you should be able to change any group subject up to 35 characters, this is similar to the Theos hack.