Auties00 / Cobalt

Standalone unofficial fully-featured Whatsapp Web and Mobile API for Java and Kotlin
MIT License
634 stars 185 forks source link

Cannot generate QrCode,use web client request #274

Closed zhengshengjie666 closed 1 year ago

zhengshengjie666 commented 1 year ago

Hi Auties: I updated my local code to April 21st. When I send a new request, planning to generate a QR code for login, however, the new code cannot parse the whatsapp response. Here is whatsapp response in my log:

Node[description=xmlns, attributes={from=s.whatsapp.net, id=3059059874, enc=md, type=last}, content=[Node[description=recent_stickers_web_sync, content=[Node[description=disable_prewarm, content=[50, 64, 119, 75, 114, 116, 82, 88, 43, 65, 68, 98, 51, 105, 116, 71, 74, 90, 105, 48, 66, 83, 57, 87, 55, 80, 83, 88, 74, 50, 73, 50, 88, 114, 81, 115, 104, 74, 82, 116, 110, 116, 65, 113, 120, 112, 72, 122, 102, 43, 52, 54, 111, 117, 52, 83, 122, 120, 69, 57, 104, 48, 87, 79, 69, 120, 121, 71, 106, 106, 52, 90, 74, 55, 70, 100, 77, 114, 117, 81, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 54, 66, 114, 88, 71, 98, 84, 107, 114, 74, 54, 54, 57, 118, 83, 43, 69, 118, 110, 57, 47, 82, 105, 90, 87, 65, 65, 113, 112, 115, 54, 51, 81, 71, 111, 81, 69, 115, 80, 43, 87, 120, 69, 48, 101, 99, 57, 122, 67, 122, 57, 108, 70, 103, 105, 102, 118, 119, 122, 74, 77, 97, 103, 87, 117, 51, 67, 71, 101, 97, 74, 99, 73, 108, 74, 106, 97, 65, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 55, 80, 52, 115, 83, 99, 68, 84, 113, 50, 70, 89, 109, 98, 113, 111, 97, 89, 88, 109, 87, 85, 79, 43, 67, 82, 54, 101, 85, 74, 52, 77, 115, 79, 84, 108, 90, 89, 104, 88, 77, 80, 75, 81, 115, 51, 57, 65, 110, 55, 67, 85, 49, 118, 43, 80, 85, 70, 104, 70, 81, 99, 111, 50, 87, 67, 121, 49, 114, 97, 120, 57, 114, 108, 52, 109, 53, 103, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 116, 89, 85, 56, 107, 55, 121, 101, 119, 108, 121, 85, 89, 110, 54, 82, 87, 120, 49, 113, 83, 114, 79, 109, 100, 102, 50, 100, 114, 53, 120, 104, 50, 98, 66, 100, 85, 74, 88, 116, 53, 102, 84, 68, 74, 87, 112, 116, 106, 112, 86, 65, 119, 111, 98, 103, 80, 56, 116, 117, 53, 70, 106, 99, 99, 80, 111, 114, 71, 68, 78, 111, 72, 116, 89, 74, 109, 119, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 53, 98, 82, 114, 111, 76, 89, 52, 122, 110, 118, 90, 57, 77, 101, 85, 116, 119, 122, 88, 76, 48, 90, 66, 43, 69, 56, 121, 79, 43, 53, 85, 105, 108, 88, 110, 111, 55, 71, 115, 68, 98, 110, 97, 78, 111, 114, 49, 82, 122, 55, 84, 106, 89, 54, 113, 90, 72, 80, 87, 107, 119, 76, 102, 103, 49, 98, 82, 48, 106, 121, 113, 98, 101, 85, 84, 87, 103, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 71, 118, 98, 97, 113, 97, 79, 83, 68, 110, 99, 43, 105, 84, 103, 86, 98, 71, 118, 115, 52, 53, 105, 101, 81, 75, 71, 70, 56, 68, 74, 85, 117, 120, 73, 106, 99, 55, 48, 111, 54, 116, 104, 84, 73, 85, 81, 114, 102, 106, 111, 114, 71, 49, 74, 51, 89, 100, 101, 115, 104, 67, 69, 107, 121, 47, 68, 114, 121, 50, 81, 67, 109, 115, 76, 80, 114, 81, 61, 61]]]]]]

When I use old code request whatsapp, Here is the response:

Node[description=iq, attributes={xmlns=md, from=s.whatsapp.net, id=839193759, type=set}, content=[Node[description=pair-device, content=[Node[description=ref, content=[50, 64, 118, 71, 88, 120, 43, 99, 104, 116, 107, 86, 122, 53, 57, 50, 121, 106, 80, 115, 99, 102, 67, 90, 70, 51, 72, 108, 50, 79, 108, 82, 107, 107, 69, 66, 114, 88, 54, 75, 53, 108, 47, 74, 105, 74, 85, 73, 98, 71, 103, 51, 121, 43, 109, 51, 85, 69, 121, 81, 107, 80, 99, 120, 105, 48, 104, 68, 51, 72, 81, 65, 98, 90, 116, 52, 69, 99, 49, 103, 61, 61]], Node[description=ref, content=[50, 64, 86, 81, 110, 47, 120, 89, 102, 71, 111, 86, 116, 51, 83, 47, 118, 76, 85, 55, 89, 101, 99, 50, 54, 75, 66, 98, 56, 70, 106, 69, 85, 104, 111, 119, 90, 109, 112, 117, 100, 52, 121, 55, 109, 119, 102, 109, 90, 82, 116, 114, 118, 67, 65, 48, 50, 83, 81, 57, 74, 80, 84, 80, 43, 98, 111, 116, 114, 56, 122, 121, 79, 89, 86, 73, 86, 103, 87, 81, 61, 61]], Node[description=ref, content=[50, 64, 107, 103, 112, 79, 65, 116, 82, 81, 55, 69, 56, 104, 84, 109, 101, 119, 77, 85, 67, 86, 88, 120, 101, 98, 54, 89, 110, 116, 47, 86, 122, 112, 53, 51, 47, 69, 107, 57, 68, 112, 102, 76, 90, 50, 118, 122, 75, 113, 55, 115, 106, 66, 48, 99, 68, 112, 86, 81, 72, 72, 108, 49, 56, 83, 53, 110, 51, 86, 49, 49, 43, 67, 56, 110, 48, 86, 101, 119, 61, 61]], Node[description=ref, content=[50, 64, 74, 75, 68, 102, 85, 119, 118, 87, 54, 81, 112, 55, 111, 105, 43, 114, 71, 86, 87, 87, 67, 56, 90, 52, 103, 103, 47, 79, 109, 70, 85, 77, 47, 74, 65, 77, 68, 111, 77, 100, 49, 72, 120, 82, 86, 114, 83, 71, 53, 108, 88, 72, 54, 116, 57, 72, 75, 51, 112, 66, 70, 66, 52, 90, 90, 102, 78, 89, 71, 72, 66, 54, 89, 111, 51, 97, 90, 103, 61, 61]], Node[description=ref, content=[50, 64, 108, 109, 56, 80, 110, 108, 75, 121, 51, 68, 82, 111, 108, 103, 110, 110, 81, 115, 114, 56, 82, 87, 111, 110, 81, 90, 76, 78, 81, 120, 116, 76, 47, 86, 102, 79, 111, 88, 72, 119, 113, 54, 73, 49, 89, 75, 55, 77, 108, 90, 121, 106, 70, 65, 88, 110, 43, 99, 82, 76, 114, 66, 79, 104, 52, 86, 84, 57, 43, 90, 110, 65, 79, 100, 118, 82, 52, 103, 61, 61]], Node[description=ref, content=[50, 64, 109, 53, 105, 87, 57, 77, 71, 47, 80, 117, 119, 73, 122, 116, 99, 122, 78, 80, 121, 79, 115, 81, 109, 70, 75, 90, 101, 81, 114, 121, 89, 110, 121, 98, 82, 55, 66, 106, 55, 115, 86, 47, 57, 110, 113, 79, 122, 111, 109, 114, 118, 99, 69, 66, 81, 50, 103, 111, 80, 121, 100, 83, 113, 79, 89, 48, 97, 109, 112, 87, 106, 65, 79, 118, 121, 74, 72, 81, 61, 61]]]]]]

where is wrong?

zhengshengjie666 commented 1 year ago

I find new code use APP_ENDPOINT_HOST and APP_ENDPOINT_PORT to connect to whatsapp; old code use WEB_ENDPOINT. Now, can I use Http client get the same result? How? Or I should change back to websocket client.

Auties00 commented 1 year ago

Hi Auties: I updated my local code to April 21st. When I send a new request, planning to generate a QR code for login, however, the new code cannot parse the whatsapp response. Here is whatsapp response in my log:

Node[description=xmlns, attributes={from=s.whatsapp.net, id=3059059874, enc=md, type=last}, content=[Node[description=recent_stickers_web_sync, content=[Node[description=disable_prewarm, content=[50, 64, 119, 75, 114, 116, 82, 88, 43, 65, 68, 98, 51, 105, 116, 71, 74, 90, 105, 48, 66, 83, 57, 87, 55, 80, 83, 88, 74, 50, 73, 50, 88, 114, 81, 115, 104, 74, 82, 116, 110, 116, 65, 113, 120, 112, 72, 122, 102, 43, 52, 54, 111, 117, 52, 83, 122, 120, 69, 57, 104, 48, 87, 79, 69, 120, 121, 71, 106, 106, 52, 90, 74, 55, 70, 100, 77, 114, 117, 81, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 54, 66, 114, 88, 71, 98, 84, 107, 114, 74, 54, 54, 57, 118, 83, 43, 69, 118, 110, 57, 47, 82, 105, 90, 87, 65, 65, 113, 112, 115, 54, 51, 81, 71, 111, 81, 69, 115, 80, 43, 87, 120, 69, 48, 101, 99, 57, 122, 67, 122, 57, 108, 70, 103, 105, 102, 118, 119, 122, 74, 77, 97, 103, 87, 117, 51, 67, 71, 101, 97, 74, 99, 73, 108, 74, 106, 97, 65, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 55, 80, 52, 115, 83, 99, 68, 84, 113, 50, 70, 89, 109, 98, 113, 111, 97, 89, 88, 109, 87, 85, 79, 43, 67, 82, 54, 101, 85, 74, 52, 77, 115, 79, 84, 108, 90, 89, 104, 88, 77, 80, 75, 81, 115, 51, 57, 65, 110, 55, 67, 85, 49, 118, 43, 80, 85, 70, 104, 70, 81, 99, 111, 50, 87, 67, 121, 49, 114, 97, 120, 57, 114, 108, 52, 109, 53, 103, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 116, 89, 85, 56, 107, 55, 121, 101, 119, 108, 121, 85, 89, 110, 54, 82, 87, 120, 49, 113, 83, 114, 79, 109, 100, 102, 50, 100, 114, 53, 120, 104, 50, 98, 66, 100, 85, 74, 88, 116, 53, 102, 84, 68, 74, 87, 112, 116, 106, 112, 86, 65, 119, 111, 98, 103, 80, 56, 116, 117, 53, 70, 106, 99, 99, 80, 111, 114, 71, 68, 78, 111, 72, 116, 89, 74, 109, 119, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 53, 98, 82, 114, 111, 76, 89, 52, 122, 110, 118, 90, 57, 77, 101, 85, 116, 119, 122, 88, 76, 48, 90, 66, 43, 69, 56, 121, 79, 43, 53, 85, 105, 108, 88, 110, 111, 55, 71, 115, 68, 98, 110, 97, 78, 111, 114, 49, 82, 122, 55, 84, 106, 89, 54, 113, 90, 72, 80, 87, 107, 119, 76, 102, 103, 49, 98, 82, 48, 106, 121, 113, 98, 101, 85, 84, 87, 103, 61, 61]], Node[description=disable_prewarm, content=[50, 64, 71, 118, 98, 97, 113, 97, 79, 83, 68, 110, 99, 43, 105, 84, 103, 86, 98, 71, 118, 115, 52, 53, 105, 101, 81, 75, 71, 70, 56, 68, 74, 85, 117, 120, 73, 106, 99, 55, 48, 111, 54, 116, 104, 84, 73, 85, 81, 114, 102, 106, 111, 114, 71, 49, 74, 51, 89, 100, 101, 115, 104, 67, 69, 107, 121, 47, 68, 114, 121, 50, 81, 67, 109, 115, 76, 80, 114, 81, 61, 61]]]]]]

When I use old code request whatsapp, Here is the response:

Node[description=iq, attributes={xmlns=md, from=s.whatsapp.net, id=839193759, type=set}, content=[Node[description=pair-device, content=[Node[description=ref, content=[50, 64, 118, 71, 88, 120, 43, 99, 104, 116, 107, 86, 122, 53, 57, 50, 121, 106, 80, 115, 99, 102, 67, 90, 70, 51, 72, 108, 50, 79, 108, 82, 107, 107, 69, 66, 114, 88, 54, 75, 53, 108, 47, 74, 105, 74, 85, 73, 98, 71, 103, 51, 121, 43, 109, 51, 85, 69, 121, 81, 107, 80, 99, 120, 105, 48, 104, 68, 51, 72, 81, 65, 98, 90, 116, 52, 69, 99, 49, 103, 61, 61]], Node[description=ref, content=[50, 64, 86, 81, 110, 47, 120, 89, 102, 71, 111, 86, 116, 51, 83, 47, 118, 76, 85, 55, 89, 101, 99, 50, 54, 75, 66, 98, 56, 70, 106, 69, 85, 104, 111, 119, 90, 109, 112, 117, 100, 52, 121, 55, 109, 119, 102, 109, 90, 82, 116, 114, 118, 67, 65, 48, 50, 83, 81, 57, 74, 80, 84, 80, 43, 98, 111, 116, 114, 56, 122, 121, 79, 89, 86, 73, 86, 103, 87, 81, 61, 61]], Node[description=ref, content=[50, 64, 107, 103, 112, 79, 65, 116, 82, 81, 55, 69, 56, 104, 84, 109, 101, 119, 77, 85, 67, 86, 88, 120, 101, 98, 54, 89, 110, 116, 47, 86, 122, 112, 53, 51, 47, 69, 107, 57, 68, 112, 102, 76, 90, 50, 118, 122, 75, 113, 55, 115, 106, 66, 48, 99, 68, 112, 86, 81, 72, 72, 108, 49, 56, 83, 53, 110, 51, 86, 49, 49, 43, 67, 56, 110, 48, 86, 101, 119, 61, 61]], Node[description=ref, content=[50, 64, 74, 75, 68, 102, 85, 119, 118, 87, 54, 81, 112, 55, 111, 105, 43, 114, 71, 86, 87, 87, 67, 56, 90, 52, 103, 103, 47, 79, 109, 70, 85, 77, 47, 74, 65, 77, 68, 111, 77, 100, 49, 72, 120, 82, 86, 114, 83, 71, 53, 108, 88, 72, 54, 116, 57, 72, 75, 51, 112, 66, 70, 66, 52, 90, 90, 102, 78, 89, 71, 72, 66, 54, 89, 111, 51, 97, 90, 103, 61, 61]], Node[description=ref, content=[50, 64, 108, 109, 56, 80, 110, 108, 75, 121, 51, 68, 82, 111, 108, 103, 110, 110, 81, 115, 114, 56, 82, 87, 111, 110, 81, 90, 76, 78, 81, 120, 116, 76, 47, 86, 102, 79, 111, 88, 72, 119, 113, 54, 73, 49, 89, 75, 55, 77, 108, 90, 121, 106, 70, 65, 88, 110, 43, 99, 82, 76, 114, 66, 79, 104, 52, 86, 84, 57, 43, 90, 110, 65, 79, 100, 118, 82, 52, 103, 61, 61]], Node[description=ref, content=[50, 64, 109, 53, 105, 87, 57, 77, 71, 47, 80, 117, 119, 73, 122, 116, 99, 122, 78, 80, 121, 79, 115, 81, 109, 70, 75, 90, 101, 81, 114, 121, 89, 110, 121, 98, 82, 55, 66, 106, 55, 115, 86, 47, 57, 110, 113, 79, 122, 111, 109, 114, 118, 99, 69, 66, 81, 50, 103, 111, 80, 121, 100, 83, 113, 79, 89, 48, 97, 109, 112, 87, 106, 65, 79, 118, 121, 74, 72, 81, 61, 61]]]]]]

where is wrong?

Those tokens look wrong, I'll see what's the problem

zhengshengjie666 commented 1 year ago

Hi Auties00: I found when I change Spec.Whatsapp.WEB_PROLOGUE back to fixed value, the QrCode can generate. Current version code Spec.Whatsapp.WEB_PROLOGUE is generated by WHATSAPP_HEADER and WEB_VERSION. I don't know why.