Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

Mobile API outdated (MOBILE_TOKEN)

Open lauriolasw opened this issue 1 year ago • 11 comments

Hello! I tried using:

MOBILE_TOKEN = Buffer.from('0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM3d3683e76445591c0591bc3c034c3bca') MOBILE_USERAGENT = 'WhatsApp/2.23.13.82 iOS/15.3.1 Device/Apple-iPhone_7'

And had this error: { reason: 'old_version', status: 'fail', login: 'nnn' }

So, I attempted to update the token using the latest APK directly from the WA download site, and then md5sum:

MOBILE_TOKEN = Buffer.from('0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM9bf0dbb9983ac28770ab7c91af6b13f2') MOBILE_USERAGENT = 'WhatsApp/2.23.23.79 iOS/15.3.1 Device/Apple-iPhone_7'

And now have this error: { reason: 'bad_token', status: 'fail', login: 'nnn' }

I would appreciate any guidance or suggestions on how to resolve this issue

lauriolasw avatar Nov 17 '23 12:11 lauriolasw

My fault! correct token for 2.23.23.79 is '37dfd00588d059cec1b40fda769f2ddf', so:

MOBILE_TOKEN = Buffer.from('0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM37dfd00588d059cec1b40fda769f2ddf') MOBILE_AGENT = "WhatsApp/2.23.23.79 iOS/15.3.1 Device/Apple-iPhone_7"

Error is: { reason: 'no_routes', status: 'fail', retry_after: 3600, sms_wait: 0, voice_wait: 0, login: 'nnn92', flash_type: 0, wa_old_wait: 0, email_otp_wait: 0 }

lauriolasw avatar Nov 19 '23 19:11 lauriolasw

Feel free to make a pull request for the changes

potkek avatar Nov 26 '23 19:11 potkek

Can you tell me, what tool do you use to open WhatsApp network traffic? I also want to contribute about the issue at Baileys

Davidaprilio avatar Dec 05 '23 02:12 Davidaprilio

My fault! correct token for 2.23.23.79 is '37dfd00588d059cec1b40fda769f2ddf', so:

MOBILE_TOKEN = Buffer.from('0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM37dfd00588d059cec1b40fda769f2ddf') MOBILE_AGENT = "WhatsApp/2.23.23.79 iOS/15.3.1 Device/Apple-iPhone_7"

Error is: { reason: 'no_routes', status: 'fail', retry_after: 3600, sms_wait: 0, voice_wait: 0, login: 'nnn92', flash_type: 0, wa_old_wait: 0, email_otp_wait: 0 }

My fault! correct token for 2.23.23.79 is '37dfd00588d059cec1b40fda769f2ddf', so:

MOBILE_TOKEN = Buffer.from('0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM37dfd00588d059cec1b40fda769f2ddf') MOBILE_AGENT = "WhatsApp/2.23.23.79 iOS/15.3.1 Device/Apple-iPhone_7"

Error is: { reason: 'no_routes', status: 'fail', retry_after: 3600, sms_wait: 0, voice_wait: 0, login: 'nnn92', flash_type: 0, wa_old_wait: 0, email_otp_wait: 0 }

Why is my result 9bf0dbb9983ac28770ab7c91af6b13f2,can you tell me why. please

zllyxr avatar Dec 19 '23 21:12 zllyxr

correct token for 2.23.23.79 is '37dfd00588d059cec1b40fda769f2ddf'

To calculate: versionMD5Hex = crypto.createHash('md5').update('2.23.23.79').digest('hex');

lauriolasw avatar Dec 20 '23 15:12 lauriolasw

My fault! correct token for 2.23.23.79 is '37dfd00588d059cec1b40fda769f2ddf', so:

MOBILE_TOKEN = Buffer.from('0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM37dfd00588d059cec1b40fda769f2ddf') MOBILE_AGENT = "WhatsApp/2.23.23.79 iOS/15.3.1 Device/Apple-iPhone_7"

Error is: { reason: 'no_routes', status: 'fail', retry_after: 3600, sms_wait: 0, voice_wait: 0, login: 'nnn92', flash_type: 0, wa_old_wait: 0, email_otp_wait: 0 }

How to find that token

Riders004 avatar Jan 24 '24 11:01 Riders004

Is there any update on this?

lairhas avatar May 01 '24 11:05 lairhas

Maybe got fixed in 6.7.0 of baileys

Riders004 avatar May 01 '24 11:05 Riders004

Yes! 6.7.0 fixed

-or- If you cannot upgrade to version 6.7.0, update the files:

src/Utils/validate-connection.ts const version = config.mobile ? [2, 24, 6] : config.version

src/Defaults/index.ts MOBILE_TOKEN 0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSMc39deee27ac1a897bf07840afa7d734a MOBILE_AGENT WhatsApp/2.24.6.77 iOS/15.3.1 Device/Apple-iPhone_7

It worked for me!

lauriolasw avatar May 01 '24 14:05 lauriolasw

Yes! 6.7.0 fixed

-or- If you cannot upgrade to version 6.7.0, update the files:

src/Utils/validate-connection.ts const version = config.mobile ? [2, 24, 6] : config.version

src/Defaults/index.ts MOBILE_TOKEN 0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSMc39deee27ac1a897bf07840afa7d734a MOBILE_AGENT WhatsApp/2.24.6.77 iOS/15.3.1 Device/Apple-iPhone_7

It worked for me!

Thanks @lauriolasw, it works once, but when I tried for the 2nd time, it get me no_routes, again. Is there any possibility WhatsApp block my IP or my WhatsApp number?


Update It works now, but I'm still confused with the logic behind it. When I execute enterCode, I get this response: { "status": "ok", "type": "existing", "lid": "344939565xxxx", "login": "628777832xxxx", "security_code_set": false, "autoconf_type": 1, "secure_verifier": false } Which mean the registration is successful. But when it execute registration = sock.authState.creds || { registration: {} }, it keep getting registration: {} which mean the creds is empty.

lairhas avatar May 01 '24 16:05 lairhas

0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM9bf0dbb9983ac28770ab7c91af6b13f2

where do you get the value of "0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM9bf0dbb9983ac28770ab7c91af6b13f2"?

Nux-xader avatar Jun 09 '24 19:06 Nux-xader