defaults,utils: Minimize vectors for automation detection
This commit is contained in:
@@ -70,7 +70,7 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
|
||||
patch: false,
|
||||
snapshot: false
|
||||
},
|
||||
countryCode: 'US',
|
||||
countryCode: 'GB',
|
||||
getMessage: async () => undefined,
|
||||
cachedGroupMetadata: async () => undefined,
|
||||
makeSignalRepository: makeLibSignalRepository
|
||||
|
||||
@@ -6,7 +6,6 @@ import { proto } from '../../WAProto/index.js'
|
||||
import { DEFAULT_CACHE_TTLS, KEY_BUNDLE_TYPE, MIN_PREKEY_COUNT } from '../Defaults'
|
||||
import type {
|
||||
GroupParticipant,
|
||||
LIDMapping,
|
||||
MessageReceiptType,
|
||||
MessageRelayOptions,
|
||||
MessageUserReceipt,
|
||||
|
||||
@@ -45,6 +45,7 @@ import {
|
||||
jidEncode,
|
||||
S_WHATSAPP_NET
|
||||
} from '../WABinary'
|
||||
import { BinaryInfo } from '../WAM/BinaryInfo.js'
|
||||
import { USyncQuery, USyncUser } from '../WAUSync/'
|
||||
import { WebSocketClient } from './Client'
|
||||
|
||||
@@ -70,6 +71,8 @@ export const makeSocket = (config: SocketConfig) => {
|
||||
makeSignalRepository
|
||||
} = config
|
||||
|
||||
const publicWAMBuffer = new BinaryInfo()
|
||||
|
||||
const uqTagId = generateMdTagPrefix()
|
||||
const generateMessageTag = () => `${uqTagId}${epoch++}`
|
||||
|
||||
@@ -1000,6 +1003,7 @@ export const makeSocket = (config: SocketConfig) => {
|
||||
uploadPreKeys,
|
||||
uploadPreKeysToServerIfRequired,
|
||||
requestPairingCode,
|
||||
wamBuffer: publicWAMBuffer,
|
||||
/** Waits for the connection to WA to reach a state */
|
||||
waitForConnectionUpdate: bindWaitForConnectionUpdate(ev),
|
||||
sendWAMBuffer,
|
||||
|
||||
@@ -62,10 +62,12 @@ export const generateLoginNode = (userJid: string, config: SocketConfig): proto.
|
||||
const { user, device } = jidDecode(userJid)!
|
||||
const payload: proto.IClientPayload = {
|
||||
...getClientPayload(config),
|
||||
passive: false,
|
||||
passive: true,
|
||||
pull: true,
|
||||
username: +user,
|
||||
device: device
|
||||
device: device,
|
||||
// TODO: investigate (hard set as false atm)
|
||||
lidDbMigrated: false
|
||||
}
|
||||
return proto.ClientPayload.fromObject(payload)
|
||||
}
|
||||
@@ -74,7 +76,7 @@ const getPlatformType = (platform: string): proto.DeviceProps.PlatformType => {
|
||||
const platformType = platform.toUpperCase()
|
||||
return (
|
||||
proto.DeviceProps.PlatformType[platformType as keyof typeof proto.DeviceProps.PlatformType] ||
|
||||
proto.DeviceProps.PlatformType.DESKTOP
|
||||
proto.DeviceProps.PlatformType.CHROME
|
||||
)
|
||||
}
|
||||
|
||||
@@ -91,14 +93,31 @@ export const generateRegistrationNode = (
|
||||
const companion: proto.IDeviceProps = {
|
||||
os: config.browser[0],
|
||||
platformType: getPlatformType(config.browser[1]),
|
||||
requireFullSync: config.syncFullHistory
|
||||
requireFullSync: config.syncFullHistory,
|
||||
historySyncConfig: {
|
||||
storageQuotaMb: 569150,
|
||||
inlineInitialPayloadInE2EeMsg: true,
|
||||
supportCallLogHistory: false,
|
||||
supportBotUserAgentChatHistory: true,
|
||||
supportCagReactionsAndPolls: true,
|
||||
supportBizHostedMsg: true,
|
||||
supportRecentSyncChunkMessageCountTuning: true,
|
||||
supportHostedGroupMsg: true,
|
||||
supportFbidBotChatHistory: true,
|
||||
supportMessageAssociation: true
|
||||
},
|
||||
version: {
|
||||
primary: 10,
|
||||
secondary: 15,
|
||||
tertiary: 7
|
||||
}
|
||||
}
|
||||
|
||||
const companionProto = proto.DeviceProps.encode(companion).finish()
|
||||
|
||||
const registerPayload: proto.IClientPayload = {
|
||||
...getClientPayload(config),
|
||||
passive: false,
|
||||
passive: true,
|
||||
pull: false,
|
||||
devicePairingData: {
|
||||
buildHash: appVersionBuf,
|
||||
|
||||
Reference in New Issue
Block a user