Skip to content

Conversation

@vinikjkkj
Copy link
Collaborator

how to use

	const sock = makeWASocket({
		version,
		logger,
		auth: {
			creds: state.creds,
			/** caching makes the store faster to send/recv messages */
			keys: makeCacheableSignalKeyStore(state.keys, logger),
		},
		browser: Browsers.android('13'), // here
		msgRetryCounterCache,
		generateHighQualityLinkPreview: true,
		// ignore all broadcast messages -- to receive the same
		// comment the line below out
		// shouldIgnoreJid: jid => isJidBroadcast(jid),
		// implement to handle retries & poll updates
		getMessage
	})

@whiskeysockets-bot
Copy link
Contributor

whiskeysockets-bot commented Dec 19, 2025

Thanks for opening this pull request and contributing to the project!

The next step is for the maintainers to review your changes. If everything looks good, it will be approved and merged into the main branch.

In the meantime, anyone in the community is encouraged to test this pull request and provide feedback.

✅ How to confirm it works

If you’ve tested this PR, please comment below with:

Tested and working ✅

This helps us speed up the review and merge process.

📦 To test this PR locally:

# NPM
npm install @whiskeysockets/baileys@WhiskeySockets/Baileys#android-browser

# Yarn (v2+)
yarn add @whiskeysockets/baileys@WhiskeySockets/Baileys#android-browser

# PNPM
pnpm add @whiskeysockets/baileys@WhiskeySockets/Baileys#android-browser

If you encounter any issues or have feedback, feel free to comment as well.

@WolfyFlutter
Copy link

WolfyFlutter commented Dec 19, 2025

sir i got this error
file:///C:/Users/Wolfy/github/angelina/index.js:145
browser: Browsers.android('13'), // here,
^

TypeError: Browsers.android is not a function
at startSock (file:///C:/Users/Wolfy/github/angelina/index.js:145:23)

Node.js v24.11.1
Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76

my package json

{
  "dependencies": {
    "@cacheable/node-cache": "^1.7.4",
    "@whiskeysockets/baileys": "github:WhiskeySockets/Baileys#android-browser",
    "baileys": "github:WhiskeySockets/Baileys",
    "pino": "^9.14.0"
  },
  "name": "bot_wa",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "node --inspect --expose-gc index.js",
    "start": "node index.js"
  },
  "keywords": [
    "baileys",
    "whatsapp",
    "bot"
  ],
  "author": "wolep",
  "license": "MIT",
  "type": "module"
}

my config

  sock = makeWASocket({
    version,
    auth: {
      creds: state.creds,
      /** caching makes the store faster to send/recv messages */
      keys: makeCacheableSignalKeyStore(state.keys, logger),
    },
    browser: Browsers.android('13'), // here,
    msgRetryCounterCache,
    cachedGroupMetadata: store.getGroupMetadata,
    logger,
    patchMessageBeforeSending,
    syncFullHistory: false,
    shouldSyncHistoryMessage: msg => {
      console.log("should sycn history message", msg)
      return false
    },
  });

i did delete node_modules and package-lock.json, and then hit npm i

@SheIITear
Copy link
Contributor

sir i got this error

file:///C:/Users/Wolfy/github/angelina/index.js:145

browser: Browsers.android('13'), // here,

                  ^

TypeError: Browsers.android is not a function

at startSock (file:///C:/Users/Wolfy/github/angelina/index.js:145:23)

Node.js v24.11.1

Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76

my package json

{

  "dependencies": {

    "@cacheable/node-cache": "^1.7.4",

    "@whiskeysockets/baileys": "github:WhiskeySockets/Baileys#android-browser",

    "baileys": "github:WhiskeySockets/Baileys",

    "pino": "^9.14.0"

  },

  "name": "bot_wa",

  "version": "1.0.0",

  "description": "",

  "main": "index.js",

  "scripts": {

    "test": "node --inspect --expose-gc index.js",

    "start": "node index.js"

  },

  "keywords": [

    "baileys",

    "whatsapp",

    "bot"

  ],

  "author": "wolep",

  "license": "MIT",

  "type": "module"

}

my config

  sock = makeWASocket({

    version,

    auth: {

      creds: state.creds,

      /** caching makes the store faster to send/recv messages */

      keys: makeCacheableSignalKeyStore(state.keys, logger),

    },

    browser: Browsers.android('13'), // here,

    msgRetryCounterCache,

    cachedGroupMetadata: store.getGroupMetadata,

    logger,

    patchMessageBeforeSending,

    syncFullHistory: false,

    shouldSyncHistoryMessage: msg => {

      console.log("should sycn history message", msg)

      return false

    },

  });

i did delete node_modules and package-lock.json, and then hit npm i

You didn't even use the pr? The code is not pushed into main.

@WolfyFlutter
Copy link

WolfyFlutter commented Dec 19, 2025

You didn't even use the pr? The code is not pushed into main.

damn... i wasnt notice my package.json 😭😭.. brb testing. sorry i was sleepy lol xD

@WolfyFlutter
Copy link

WolfyFlutter commented Dec 19, 2025

image

very good, it work! excellent job! no need to reply to see rvo content.. no more stubtype message absent from node

const getPlatformType = (platform: string): proto.DeviceProps.PlatformType => {
const platformType = platform.toUpperCase()
if (platformType === 'ANDROID') {
return proto.DeviceProps.PlatformType.ANDROID_PHONE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting. Is this the only thing for companion devices? Can you try ipad

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also try enum IPHONE

@DavidModzz
Copy link

Tested and working

@astrox11
Copy link

Crazy workaround fix 🙌 amazing job

@purpshell
Copy link
Member

purpshell commented Dec 19, 2025

Good fix but we need to insure full support for companion devices

@jlucaso1 could you use frida perhaps to pin the android companion mode to bartender?
note: you can use the android studio emulators, they come pre-rooted, you just need to upload the frida-server there

@cleitonme
Copy link

Here I can't connect WhatsApp Business, it only connects normally. It works but had this problem

@vinikjkkj
Copy link
Collaborator Author

Good fix but we need to insure full support for companion devices

@jlucaso1 could you use frida perhaps to pin the android companion mode to bartender? note: you can use the android studio emulators, they come pre-rooted, you just need to upload the frida-server there

i found this when i was reversing companion mode, if you guys want i have ~90% reversed (CRSC v2/v3)

@vinikjkkj
Copy link
Collaborator Author

Here I can't connect WhatsApp Business, it only connects normally. It works but had this problem

try changing from

		platform: config.browser[1].toLocaleLowerCase().includes('android')
			? proto.ClientPayload.UserAgent.Platform.ANDROID
			: proto.ClientPayload.UserAgent.Platform.WEB,

to

		platform: config.browser[1].toLocaleLowerCase().includes('android')
			? proto.ClientPayload.UserAgent.Platform.SMB_ANDROID
			: proto.ClientPayload.UserAgent.Platform.WEB,

@purpshell
Copy link
Member

Here I can't connect WhatsApp Business, it only connects normally. It works but had this problem

try changing from

		platform: config.browser[1].toLocaleLowerCase().includes('android')
			? proto.ClientPayload.UserAgent.Platform.ANDROID
			: proto.ClientPayload.UserAgent.Platform.WEB,

to

		platform: config.browser[1].toLocaleLowerCase().includes('android')
			? proto.ClientPayload.UserAgent.Platform.SMB_ANDROID
			: proto.ClientPayload.UserAgent.Platform.WEB,

This needs to be handled with code rather than posting comments on fixes.

Anyways, the reason this has not gotten an immediate approval from me is due to the lack of safeguards or testing for this in regards to incomplete companion mode support which could increase attack vectors due to lack of implementation

@vinikjkkj vinikjkkj marked this pull request as draft December 22, 2025 15:17
@WolfyFlutter
Copy link

update : i cant use pairing code with this pr.. qr havent tested yet.
but when i use baileys on npm the pairing code works

@justpiple
Copy link

justpiple commented Jan 1, 2026

Tested and working ✅

Edit: Pairing code doesn’t work properly.

@WolfyFlutter
Copy link

Tested and working ✅

does it work with pairing code?

@github-actions
Copy link
Contributor

This PR is stale because it has been open for 14 days with no activity. Remove the stale label or comment or this will be closed in 14 days

@github-actions github-actions bot added the Stale label Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.