Fixing whatsapp on iOS8 beta

The issue is already well documented, I’m pulling them together here and adding some ideas.

The cause is an error in handling Typographic Ligature http://en.wikipedia.org/wiki/Typographic_ligature (actually I don’t care, just in case you do)

The current behaviour is:

A. if you type a message with ff, fl or fi and hit Send, whatsapp crashes, you don’t see the message in your phone, but the message is actually sent.

B. if you receive a message with ff, fl or fi, whatsapp crashes when you open the message, but the message continues to reside in the database, and thus you will not be able to converse with this person / group until something is done.

For scenario A, there’s nothing you can do, but at least communication continues (you just don’t have a log of the message).

For scenario B, my solution of choice is based on this snippet on github

Steps

  1. Download and launch iExplorer
    http://www.macroplant.com/iexplorer/
  2. Download and launch SQLiteBrowser
    http://sqlitebrowser.org
  3. In iExplorer, look for Apps, WhatsApp, and drag ChatStorage.sqlite to your desktop
  4. Drag that file again into SQLLiteBrowser (optional – create a duplicate for backup for safety)
  5. Click on Execute SQL, paste the following in and then click the Play button to execute the queries

    update ZWAMESSAGE set ZTEXT = replace( ZTEXT, 'ff', 'f_f') where ZWAMESSAGE.ZTEXT like '%ff%';
    update ZWAMESSAGE set ZTEXT = replace( ZTEXT, 'ff', 'f_f') where ZWAMESSAGE.ZTEXT like '%ff%';
    update ZWAMESSAGE set ZTEXT = replace( ZTEXT, 'fi', 'f_i') where ZWAMESSAGE.ZTEXT like '%fi%';
    update ZWAMESSAGE set ZTEXT = replace( ZTEXT, 'fl', 'f_l') where ZWAMESSAGE.ZTEXT like '%fl%';

    DROP TRIGGER ios8_fix;
    CREATE TRIGGER ios8_fix AFTER INSERT ON ZWAMESSAGE FOR EACH ROW
    BEGIN
    UPDATE ZWAMESSAGE SET ZTEXT = replace(ZTEXT, 'ff', 'f_f') WHERE ROWID = NEW.ROWID;
    UPDATE ZWAMESSAGE SET ZTEXT = replace(ZTEXT, 'ff', 'f_f') WHERE ROWID = NEW.ROWID;
    UPDATE ZWAMESSAGE SET ZTEXT = replace(ZTEXT, 'fi', 'f_i') WHERE ROWID = NEW.ROWID;
    UPDATE ZWAMESSAGE SET ZTEXT = replace(ZTEXT, 'fl', 'f_l') WHERE ROWID = NEW.ROWID;
    END;

    The 1st query (ff) needs to be executed twice because of words like wtffffff. The first time replacement will create wtf_ff_ff_f, and the second round wtf_f_f_f_f_f.

    I didn’t quite like the [f f] style coz I also type messages to others and it’s easier to type f_f and looks more normal to the receiving party. Feel free to change this (if you add something at the end you don’t need to repeat the query).

  6. Quit SQLiteBrowser and save the file.
  7. Drag the file back to where you got it from in iExplorer. Choose to Replace the file

The resulting behaviour might still result in a crash, but a second launch will be successful.

Thoughts welcomed.

Ok back to work on iOS8.

p/s At some point in the future when the problem is gone, I would do a final update

update ZWAMESSAGE set ZTEXT = replace(ZTEXT, 'f_f', 'ff') where ZWAMESSAGE.ZTEXT like '%f_f%';
update ZWAMESSAGE set ZTEXT = replace(ZTEXT, 'f_f', 'ff') where ZWAMESSAGE.ZTEXT like '%f_f%';
update ZWAMESSAGE set ZTEXT = replace(ZTEXT, 'f_i', 'fi') where ZWAMESSAGE.ZTEXT like '%f_i%';
update ZWAMESSAGE set ZTEXT = replace(ZTEXT, 'f_l', 'fl') where ZWAMESSAGE.ZTEXT like '%f_l%';

DROP TRIGGER ios8_fix;

to revert my entire database to the original.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published.

Back to Top