sigalor / whatsapp-web-reveng

Reverse engineering WhatsApp Web.
MIT License
6.14k stars 806 forks source link

Finally I Success send message! but there is a problem about messageTimestamp #139

Open kevincollin opened 6 years ago

kevincollin commented 6 years ago

Hello @sigalor ,

Thank you, I have successfully sent text message to the contact on my WhatsApp!!

but there was a problem.. something wrong with the delivery itself.

I have a problem with the time that the message shows (messageTimestamp).

---I attach the screenshot whatsapp-web-small

The problem is if I fill the messageTimestamp with timestamp type seconds, sometimes the message cannot be sent OR

if the message could be sent, the sending date on the sender's smartphone is WRONG

the time is exceeds today's date, for example: March 11, 238529416.

(For the recipient of the message, the displayed time does not experience problems. The time shows today / the results are correct).

I used to think that the messageTimestamp data type using uint64, but in the Python programming language it only provides long data types. was it right??

Do you have any ideas, insights or input for this problem? to prevent wrong sender's time message

Please help, thank you Sigalor

kevincollin commented 6 years ago

Please help too master @Rhymen @wiomoc @tiwarishrijan @valga @SuperSandro2000 thank you so much

tiwarishrijan commented 6 years ago

@kevincollin Can you paste your reference code here,,,

kevincollin commented 6 years ago

@tiwarishrijan , this is my sendTextMessage code


def sendTextMessage(self, number, text):        

    messageId = "3EB0"+binascii.hexlify(Random.get_random_bytes(8)).upper()

    messageTag = str(getTimestamp())

    messageParams = {"key": {"fromMe": True, "remoteJid": number + "@s.whatsapp.net", "id": messageId},"messageTimestamp": getTimestamp(), "status": 1, "message": {"conversation": text}}

    msgData = ["action", {"type": "relay", "epoch": str(self.messageSentCount)},[["message", None, WAWebMessageInfo.encode(messageParams)]]]

    encryptedMessage = WhatsAppEncrypt(self.loginInfo["key"]["encKey"], self.loginInfo["key"]["macKey"],whatsappWriteBinary(msgData))

    payload = bytearray(messageId) + bytearray(",") + bytearray(to_bytes(WAMetrics.MESSAGE, 1)) + bytearray([0x80]) + encryptedMessage

    self.messageSentCount = self.messageSentCount + 1

    self.messageQueue[messageId] = {"desc": "__sending"}

    self.activeWs.send(payload, websocket.ABNF.OPCODE_BINARY)```
tiwarishrijan commented 6 years ago

I am also stuck onto the same place, as sometime code is working and sometime code is not working. I also tried implementing Skew but same result.

kevincollin commented 6 years ago

I am also stuck onto the same place, as sometime code is working and sometime code is not working. I also tried implementing Skew but same result.

is the delivery date have a relation with the format of writing binary messages? or the encode process? @tiwarishrijan

tiwarishrijan commented 6 years ago

I am also stuck onto the same place, as sometime code is working and sometime code is not working. I also tried implementing Skew but same result.

is the delivery date have a relation with the format of writing binary messages? or the encode process? @tiwarishrijan

Till now it seems like issue with the binary encoding, Please do let me know if you find something..

kevincollin commented 6 years ago

I am also stuck onto the same place, as sometime code is working and sometime code is not working. I also tried implementing Skew but same result.

is the delivery date have a relation with the format of writing binary messages? or the encode process? @tiwarishrijan

Till now it seems like issue with the binary encoding, Please do let me know if you find something..

oke.

demontara commented 6 years ago

Hello @sigalor ,

Thank you, I have successfully sent text message to the contact on my WhatsApp!!

but there was a problem.. something wrong with the delivery itself.

I have a problem with the time that the message shows (messageTimestamp).

---I attach the screenshot whatsapp-web-small

The problem is if I fill the messageTimestamp with timestamp type seconds, sometimes the message cannot be sent OR

if the message could be sent, the sending date on the sender's smartphone is WRONG

the time is exceeds today's date, for example: March 11, 238529416.

(For the recipient of the message, the displayed time does not experience problems. The time shows today / the results are correct).

I used to think that the messageTimestamp data type using uint64, but in the Python programming language it only provides long data types. was it right??

Do you have any ideas, insights or input for this problem? to prevent wrong sender's time message

Please help, thank you Sigalor

Hello,

How did you send message using this function? Can you help me,

Regards

tigsdev commented 5 years ago

Solution for sending messages?

bottookku commented 5 years ago

how you call this method??? where in whatsapp_web_backend? how initialization class ?? please i want see it

shashwat001 commented 5 years ago

@kevincollin Were you able to figure out this issue?

SwapnilSoni1999 commented 4 years ago

can you describe please how you sent message?

jonathanmsch commented 4 years ago

Hello guys! I'm having the same problem with mesage timestamp. Did someone find a solution?

arisawali2014 commented 4 years ago

Hello guys! I'm having the same problem with mesage timestamp. Did someone find a solution?

do you know the solution for sending text?