Louuke / WhatsJava

Implementation of the WhatsApp Web API in Java
Apache License 2.0
37 stars 16 forks source link

Run Error #2

Closed syifarahmat closed 3 years ago

syifarahmat commented 3 years ago

I Try you library always error after login success...! image

but is oke for send & receive message

Louuke commented 3 years ago

Hey, thanks for trying out the library!

I have just tried it again and I can't reproduce your error. So it would be interesting to know which message should be decoded and causes the error.

You could change the readNode method within the BinaryDecoder class to find out what the message contains. Something like this:

// Conversation messages
case BinaryConstants.Tags.BINARY_8:
    byte[] bin8 = readBytes(readByte() & 0xff);

    // Insert here
    System.out.println("BIN8: " + new String(bin8));

    base64Decoded = Base64.getEncoder().encodeToString(
    WebMessageInfo.parseFrom(bin8).toByteArray());

    break;

Be aware that the message may contain personal information before you post it.

For now you may comment out the exception if it should bother you.

Thanks again for helping!

syifarahmat commented 3 years ago

No personal information here 😄 This is end before error : image

Louuke commented 3 years ago

Hm, that's strange.

The "message" messages are always encoded in protobuf format, so it's strange that the message is directly readable without artifacts.

Can you tell me if this is a "normal" text message or something else? I would guess that this is a status message, right?

In fact, I have never tested status messages that contain only text, because for some reason they don't load on my device and I never bothered about it :satisfied:

syifarahmat commented 3 years ago

I would guess that this is a status message, right? yes this status message.....

Yes.... This bug, after the status message has been more than 24 hours and there are no more, there are no errors

Thanks job 👍

Louuke commented 3 years ago

Okay, I tried again loading status messages on a second device and it worked there as well. So I'm still not sure what caused the status message error.

But I am glad that it works now.