UNPKG

superchats

Version:

SuperChats is a premium library with unique features that control Whatsapp functions. With Superchats you can build service bots, multiservice chats or any system that uses whatsapp

1 lines 10.5 kB
'use strict';const a82_0x521f71=a82_0x21ca;function a82_0x561e(){const _0x451efd=['biz','ADVSignedDeviceIdentity','15.3.1','PlatformType','ConnectType','public','creds','generateLoginNode','pair-success','40614fPxRec','Apple','9ZUVSjW','fromObject','attrs','createSignalIdentity','keyPair','deviceSignature','registration','syncFullHistory','decode','keyIndex','base64','../../Connection/enc','accountSignatureKey','ReleaseChannel','getBinaryNodeChild','pair-device-sign','60740WmVMet','ClientPayload','toUpperCase','WebInfo','from','DESKTOP','configureSuccessfulPairing','defineProperty','jid','device-identity','device','generateMobileNode','000','sign','floor','generateRegistrationNode','Curve','110141HLfGfa','encode','digest','verify','name','result','WebSubPlatform','2QHBNEH','KEY_BUNDLE_TYPE','details','browser','toString','DeviceProps','encodeSignedDeviceIdentity','auth','Platform','WIFI_UNKNOWN','WEB_BROWSER','content','DNSResolutionMethod','concat','keyId','USER_ACTIVATED','S_WHATSAPP_NET','random','1211460HNkgDF','655490WUxEwp','hmacSign','mobile','DNSSource','SYSTEM','phoneNumberMobileCountryCode','Desktop','0.1','../../Internal','md5','UserAgent','1347560jzSUlU','18CKziRD','compare','phoneId','test','ConnectReason','WEB','717088yePEYH','webInfo','phoneNumberCountryCode','update','encodeBigEndian','join','jidDecode','proto'];a82_0x561e=function(){return _0x451efd;};return a82_0x561e();}(function(_0x3b6c05,_0x2efeae){const _0x3d926d=a82_0x21ca,_0x4db02b=_0x3b6c05();while(!![]){try{const _0x323dbd=parseInt(_0x3d926d(0x1c9))/0x1*(-parseInt(_0x3d926d(0x1d0))/0x2)+parseInt(_0x3d926d(0x208))/0x3*(parseInt(_0x3d926d(0x1b8))/0x4)+parseInt(_0x3d926d(0x1ee))/0x5+parseInt(_0x3d926d(0x1e2))/0x6+-parseInt(_0x3d926d(0x206))/0x7+-parseInt(_0x3d926d(0x1f5))/0x8*(parseInt(_0x3d926d(0x1ef))/0x9)+-parseInt(_0x3d926d(0x1e3))/0xa;if(_0x323dbd===_0x2efeae)break;else _0x4db02b['push'](_0x4db02b['shift']());}catch(_0x13ebfb){_0x4db02b['push'](_0x4db02b['shift']());}}}(a82_0x561e,0x26235));Object[a82_0x521f71(0x1bf)](exports,'__esModule',{'value':!![]}),exports[a82_0x521f71(0x1d6)]=exports[a82_0x521f71(0x1be)]=exports['generateRegistrationNode']=exports['generateLoginNode']=exports[a82_0x521f71(0x1c3)]=void 0x0;const crypto_1=require('crypto'),enc_1=require(a82_0x521f71(0x1b3)),mode_1=require('../../Connection/mode'),Internal_1=require(a82_0x521f71(0x1eb)),enc_2=require('./enc'),similary_1=require('./similary'),line_1=require('../utils/line'),getUserAgent=_0x206a64=>{const _0x275793=a82_0x521f71;var _0x146b75,_0x4ff8c4;const _0x12d4ae=_0x206a64[_0x275793(0x1e5)]?_0x275793(0x1ff):_0x275793(0x1ea),_0x569508=_0x206a64[_0x275793(0x1e5)]?[0x2,0x16,0x18]:_0x206a64['version'],_0x4128d4=_0x206a64['mobile']?'iPhone_7':_0x275793(0x1e9),_0x7cf6fe=_0x206a64[_0x275793(0x1e5)]?_0x275793(0x207):'',_0x59d2bb=_0x206a64[_0x275793(0x1e5)]?enc_1['proto'][_0x275793(0x1b9)][_0x275793(0x1ed)][_0x275793(0x1d8)]['IOS']:enc_1[_0x275793(0x1fc)][_0x275793(0x1b9)][_0x275793(0x1ed)]['Platform'][_0x275793(0x1f4)],_0x1962a2=_0x206a64[_0x275793(0x1e5)]?{'phoneId':_0x206a64[_0x275793(0x1d7)]['creds'][_0x275793(0x1f1)]}:{};return{'appVersion':{'primary':_0x569508[0x0],'secondary':_0x569508[0x1],'tertiary':_0x569508[0x2]},'platform':_0x59d2bb,'releaseChannel':enc_1[_0x275793(0x1fc)][_0x275793(0x1b9)][_0x275793(0x1ed)][_0x275793(0x1b5)]['RELEASE'],'mcc':((_0x146b75=_0x206a64[_0x275793(0x1d7)][_0x275793(0x203)][_0x275793(0x1ae)])===null||_0x146b75===void 0x0?void 0x0:_0x146b75[_0x275793(0x1e8)])||_0x275793(0x1c4),'mnc':((_0x4ff8c4=_0x206a64[_0x275793(0x1d7)][_0x275793(0x203)][_0x275793(0x1ae)])===null||_0x4ff8c4===void 0x0?void 0x0:_0x4ff8c4['phoneNumberMobileNetworkCode'])||_0x275793(0x1c4),'osVersion':_0x12d4ae,'manufacturer':_0x7cf6fe,'device':_0x4128d4,'osBuildNumber':_0x12d4ae,'localeLanguageIso6391':'en','localeCountryIso31661Alpha2':'US',..._0x1962a2};},PLATFORM_MAP={'Mac\x20OS':enc_1['proto'][a82_0x521f71(0x1b9)][a82_0x521f71(0x1bb)][a82_0x521f71(0x1cf)]['DARWIN'],'Windows':enc_1['proto'][a82_0x521f71(0x1b9)]['WebInfo'][a82_0x521f71(0x1cf)]['WIN32']},getWebInfo=_0x56affe=>{const _0x2cc446=a82_0x521f71;let _0x55bb1e=enc_1[_0x2cc446(0x1fc)][_0x2cc446(0x1b9)][_0x2cc446(0x1bb)]['WebSubPlatform'][_0x2cc446(0x1da)];return _0x56affe[_0x2cc446(0x1af)]&&PLATFORM_MAP[_0x56affe[_0x2cc446(0x1d3)][0x0]]&&(_0x55bb1e=PLATFORM_MAP[_0x56affe[_0x2cc446(0x1d3)][0x0]]),{'webSubPlatform':_0x55bb1e};},getClientPayload=_0xe881cf=>{const _0x4524ca=a82_0x521f71,_0x5644fb={'connectType':enc_1[_0x4524ca(0x1fc)][_0x4524ca(0x1b9)][_0x4524ca(0x201)][_0x4524ca(0x1d9)],'connectReason':enc_1[_0x4524ca(0x1fc)][_0x4524ca(0x1b9)][_0x4524ca(0x1f3)][_0x4524ca(0x1df)],'userAgent':getUserAgent(_0xe881cf)};return!_0xe881cf[_0x4524ca(0x1e5)]&&(_0x5644fb[_0x4524ca(0x1f6)]=getWebInfo(_0xe881cf)),_0x5644fb;},generateMobileNode=_0x41c589=>{const _0x236039=a82_0x521f71;if(!_0x41c589[_0x236039(0x1d7)][_0x236039(0x203)])throw null;const _0x1e3bd7={...getClientPayload(_0x41c589),'sessionId':Math[_0x236039(0x1c6)](Math[_0x236039(0x1e1)]()*0x3b9ac9ff+0x1),'shortConnect':!![],'connectAttemptCount':0x0,'device':0x0,'dnsSource':{'appCached':![],'dnsMethod':enc_1['proto']['ClientPayload'][_0x236039(0x1e6)][_0x236039(0x1dc)][_0x236039(0x1e7)]},'passive':![],'pushName':_0x236039(0x1f2),'username':Number(''+_0x41c589['auth'][_0x236039(0x203)][_0x236039(0x1ae)][_0x236039(0x1f7)]+_0x41c589[_0x236039(0x1d7)][_0x236039(0x203)][_0x236039(0x1ae)]['phoneNumberNationalNumber'])};return enc_1[_0x236039(0x1fc)][_0x236039(0x1b9)][_0x236039(0x209)](_0x1e3bd7);};exports[a82_0x521f71(0x1c3)]=generateMobileNode;const getPlatformType=_0xec6d59=>{const _0x4a0f58=a82_0x521f71,_0x5a17bc=_0xec6d59[_0x4a0f58(0x1ba)]();return enc_1[_0x4a0f58(0x1fc)][_0x4a0f58(0x1d5)][_0x4a0f58(0x200)][_0x5a17bc]||enc_1[_0x4a0f58(0x1fc)]['DeviceProps'][_0x4a0f58(0x200)][_0x4a0f58(0x1bd)];},generateLoginNode=(_0x544ae4,_0x2e547c)=>{const _0x4eff99=a82_0x521f71,{user:_0x656417,device:_0x159d8f}=(0x0,Internal_1[_0x4eff99(0x1fb)])(_0x544ae4),_0x589cb2={...getClientPayload(_0x2e547c),'passive':!![],'username':+_0x656417,'device':_0x159d8f};return enc_1[_0x4eff99(0x1fc)][_0x4eff99(0x1b9)]['fromObject'](_0x589cb2);};function a82_0x21ca(_0x1f820a,_0xc84b){const _0x561ec5=a82_0x561e();return a82_0x21ca=function(_0x21cabb,_0x4a015d){_0x21cabb=_0x21cabb-0x1ad;let _0x1b0b2e=_0x561ec5[_0x21cabb];return _0x1b0b2e;},a82_0x21ca(_0x1f820a,_0xc84b);}exports[a82_0x521f71(0x204)]=generateLoginNode;const generateRegistrationNode=({registrationId:_0x37c419,signedPreKey:_0x3f4e82,signedIdentityKey:_0x228b31},_0x206a83)=>{const _0x16ce3f=a82_0x521f71,_0x3cf2df=(0x0,crypto_1['createHash'])(_0x16ce3f(0x1ec))[_0x16ce3f(0x1f8)](_0x206a83['version'][_0x16ce3f(0x1fa)]('.'))[_0x16ce3f(0x1cb)](),_0x56c3a9={'os':_0x206a83['browser'][0x0],'platformType':getPlatformType(_0x206a83[_0x16ce3f(0x1d3)][0x1]),'requireFullSync':_0x206a83['syncFullHistory']},_0x1991d0=enc_1[_0x16ce3f(0x1fc)][_0x16ce3f(0x1d5)][_0x16ce3f(0x1ca)](_0x56c3a9)['finish'](),_0x2638bc={...getClientPayload(_0x206a83),'passive':![],'devicePairingData':{'buildHash':_0x3cf2df,'deviceProps':_0x1991d0,'eRegid':(0x0,similary_1['encodeBigEndian'])(_0x37c419),'eKeytype':mode_1[_0x16ce3f(0x1d1)],'eIdent':_0x228b31[_0x16ce3f(0x202)],'eSkeyId':(0x0,similary_1[_0x16ce3f(0x1f9)])(_0x3f4e82[_0x16ce3f(0x1de)],0x3),'eSkeyVal':_0x3f4e82[_0x16ce3f(0x20c)]['public'],'eSkeySig':_0x3f4e82['signature']}};return enc_1[_0x16ce3f(0x1fc)][_0x16ce3f(0x1b9)]['fromObject'](_0x2638bc);};exports[a82_0x521f71(0x1c7)]=generateRegistrationNode;const configureSuccessfulPairing=(_0x3b5de1,{advSecretKey:_0x52c0f6,signedIdentityKey:_0x5d9006,signalIdentities:_0x54e637})=>{const _0x2dc960=a82_0x521f71,_0x56fffe=_0x3b5de1[_0x2dc960(0x20a)]['id'],_0x582413=(0x0,Internal_1[_0x2dc960(0x1b6)])(_0x3b5de1,_0x2dc960(0x205)),_0x3d00c2=(0x0,Internal_1[_0x2dc960(0x1b6)])(_0x582413,_0x2dc960(0x1c1)),_0x537dc6=(0x0,Internal_1['getBinaryNodeChild'])(_0x582413,'platform'),_0x1946cf=(0x0,Internal_1['getBinaryNodeChild'])(_0x582413,_0x2dc960(0x1c2)),_0x302698=(0x0,Internal_1[_0x2dc960(0x1b6)])(_0x582413,_0x2dc960(0x1fd));if(!_0x3d00c2||!_0x1946cf)throw null;const _0x5915fd=_0x302698===null||_0x302698===void 0x0?void 0x0:_0x302698[_0x2dc960(0x20a)][_0x2dc960(0x1cd)],_0x5daba0=_0x1946cf[_0x2dc960(0x20a)][_0x2dc960(0x1c0)],{details:_0x3bdba3,hmac:_0x5c5429}=enc_1[_0x2dc960(0x1fc)]['ADVSignedDeviceIdentityHMAC'][_0x2dc960(0x1b0)](_0x3d00c2[_0x2dc960(0x1db)]),_0x3307eb=(0x0,enc_2[_0x2dc960(0x1e4)])(_0x3bdba3,Buffer[_0x2dc960(0x1bc)](_0x52c0f6,_0x2dc960(0x1b2)));if(Buffer[_0x2dc960(0x1f0)](_0x5c5429,_0x3307eb)!==0x0)throw null;const _0x1fb9bc=enc_1[_0x2dc960(0x1fc)][_0x2dc960(0x1fe)][_0x2dc960(0x1b0)](_0x3bdba3),{accountSignatureKey:_0x4403a1,accountSignature:_0x35ff3c,details:_0xefba88}=_0x1fb9bc,_0x5cd57a=Buffer[_0x2dc960(0x1dd)]([Buffer[_0x2dc960(0x1bc)]([0x6,0x0]),_0xefba88,_0x5d9006[_0x2dc960(0x202)]]);if(!enc_2[_0x2dc960(0x1c8)][_0x2dc960(0x1cc)](_0x4403a1,_0x5cd57a,_0x35ff3c))throw null;const _0x128aaf=Buffer[_0x2dc960(0x1dd)]([Buffer[_0x2dc960(0x1bc)]([0x6,0x1]),_0xefba88,_0x5d9006['public'],_0x4403a1]);_0x1fb9bc[_0x2dc960(0x1ad)]=enc_2[_0x2dc960(0x1c8)][_0x2dc960(0x1c5)](_0x5d9006['private'],_0x128aaf);const _0x166c42=(0x0,line_1[_0x2dc960(0x20b)])(_0x5daba0,_0x4403a1),_0x2d2a67=(0x0,exports[_0x2dc960(0x1d6)])(_0x1fb9bc,![]),_0x52904b=enc_1[_0x2dc960(0x1fc)]['ADVDeviceIdentity'][_0x2dc960(0x1b0)](_0x1fb9bc[_0x2dc960(0x1d2)]),_0x4db5d7={'tag':'iq','attrs':{'to':Internal_1[_0x2dc960(0x1e0)],'type':_0x2dc960(0x1ce),'id':_0x56fffe},'content':[{'tag':_0x2dc960(0x1b7),'attrs':{},'content':[{'tag':_0x2dc960(0x1c1),'attrs':{'key-index':_0x52904b[_0x2dc960(0x1b1)][_0x2dc960(0x1d4)]()},'content':_0x2d2a67}]}]},_0x24db7f={'account':_0x1fb9bc,'me':{'id':_0x5daba0,'name':_0x5915fd},'signalIdentities':[..._0x54e637||[],_0x166c42],'platform':_0x537dc6===null||_0x537dc6===void 0x0?void 0x0:_0x537dc6[_0x2dc960(0x20a)][_0x2dc960(0x1cd)]};return{'creds':_0x24db7f,'reply':_0x4db5d7};};exports['configureSuccessfulPairing']=configureSuccessfulPairing;const encodeSignedDeviceIdentity=(_0x510e24,_0x38739e)=>{const _0x100a9f=a82_0x521f71;var _0x1f776f;return _0x510e24={..._0x510e24},(!_0x38739e||!((_0x1f776f=_0x510e24[_0x100a9f(0x1b4)])===null||_0x1f776f===void 0x0?void 0x0:_0x1f776f['length']))&&(_0x510e24[_0x100a9f(0x1b4)]=null),enc_1[_0x100a9f(0x1fc)]['ADVSignedDeviceIdentity'][_0x100a9f(0x1ca)](_0x510e24)['finish']();};exports[a82_0x521f71(0x1d6)]=encodeSignedDeviceIdentity;