WhatsApp Patch

by Luxferre

From the official website of WhatsApp can be read the FAQ in which the minimum requirement for KaiOS is version 2.5.1, but it is not so, we know it well.

Here, we're going to post new versions of WhatsApp adapted for usage on GerdaOS and stock v13 firmware, since this WA topic is still popular in this forum. But also, we're going to post (and update) the guides of patching the stock version, so that anyone could do it themselves if needed.

In the end of this old video of the Jailbreak you can see WhatsApp installed onNokia 8110 4G with a custom system ROM v1200.17.10 but firmware and APIs from a v13.00.17.01 model.

More apps wont work properly because the /system/kaios folder that contains the APIs needed. Often should be enough to change that.

Surelly this wont work on an Alcatel Cingular Flip 2 with KaiOS 1.0, but with the right permissions you can try to use the updated APIs from my Nokia 8110 Firmware 16.00.17.00, use the right guide to replace the system's files.

Patching guide

For the current state of off-the-shelf app, patching process is as follows [you need a stock-flashed phone with WA installed (for 8110 - with v15 and above), a target phone and adb]:


1) Gain the temporary root on the stock.

2) Create a directory and enter it, and then create another directory called application, for instance:

mkdir -p ~/wa-patch && cd ~/wa-patch && mkdir application

3) Pull the contents of the WA application already installed on the rooted stock:

adb pull /data/local/webapps/kaios.whatsapp.net/application.zip application/application.zip

4) Unpack the contents and remove the archive itself:

cd application && unzip application.zip && rm application.zip

5) Remove META-INF directory (this is very important, otherwise signatures will not match):

rm -rf META-INF

6) Find the line that looks like this in the page.js file (starts with if(!window.Intl)):

if(!window.Intl)throw f(856),new Error("os unsupported (Intl is missing)");

7) Replace this line with this:

if(!window.Intl)window.Intl=window.mozIntl;

Save the file.

7.1) (Optionally) remove the next statement after Intl-related (contains planned app expiration date) from the same page.js that looks like this:

if(Date.now()>=1569023999e3)throw f(414),new Error("expired app");

(in this case it's pointing to expire at September 21 2019)

Save the file.

8) If you want to, you may already deploy the patched version via old Firefox/PaleMoon/NewMoon WebIDE or XPCShell onto the target. If you wish to create the GerdaPkg/OmniSD-compatible package, proceed to the next step.

9) Staying within application directory, repack the application.zip:

zip -9r --exclude=*.git* --exclude=*.DS_Store* --exclude=README.md ../application.zip .

10) Go to the level above and create metadata.json:

cd .. && echo {\"version\": 1, \"manifestURL\": \"app://kaios.whatsapp.net/manifest.webapp\"} > metadata.json

11) Staying in the level above, pack the GerdaPkg package:

 zip -9 whatsapp.gpkg.zip application.zip metadata.json

Now you can transfer, install and test the ready package (whatsapp.gpkg.zip) on the GerdaOS/v13 target.

Don't forget to uninstall the previous version and reboot before installing the new one (do a backup first).

P.S. The steps are shown for Linux/Mac, for Windows you could use Cygwin/MSYS or WSL2 environment to use the same commands, or just replace them with their Win32 counterparts.

How to backup the WhatsApp's database

by ProgrammAbel, extended by Matteo Rinaldi

1) Get a root access on your phone, for example using a temporary backdoor as it is showed in this forum;

2) Whatsapp messages are stored in the whatsapp directory placed in /data/local/storage/default;

3) Copy your whatsapp directory, which name is 1059+f+app+++kaios.whatsapp.net THE NUMBER AT THE BEGINNING IS VARIABLE;

4) Remove and reinstall the app;

5) Go back in the /data/local/storage/default, check what's the name of the new whatsapp installation (ex: 1073+f+app+++kaios.whatsapp.net) and then copy your backup in place of the new folder by changing its name;

6) Enjoy!