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 6.55 kB
'use strict';function a93_0x11c4(_0x4394a9,_0x299912){const _0x9401ab=a93_0x9401();return a93_0x11c4=function(_0x11c4f9,_0x27b62a){_0x11c4f9=_0x11c4f9-0x1b1;let _0x31e50d=_0x9401ab[_0x11c4f9];return _0x31e50d;},a93_0x11c4(_0x4394a9,_0x299912);}const a93_0x1e33b6=a93_0x11c4;function a93_0x9401(){const _0x34a3e4=['135560YeJLFs','hkdf','../../Connection/enc','aesEncryptGCM','writeUInt16BE','decode','makeNoiseHandler','Curve','setUint32','length','70DQvhAL','128086sFpNKm','1LmLeaS','sharedKey','from','writeUInt8','989208QIUaid','proto','alloc','../crypto/enc','16893thXOSi','WA_CERT_DETAILS','1844TRwQVQ','48OPdjhC','__esModule','details','set','sha256','56WAJkrD','NoiseCertificate','633182KinMjh','NOISE_MODE','readUInt16BE','byteLength','writeUint8','static','../../Connection/mode','Details','payload','444NGTYZt','aesDecryptGCM','../../Internal','writeUint16BE','ephemeral','public','CertChain','write','slice','5186460uLEQjp','readUInt8'];a93_0x9401=function(){return _0x34a3e4;};return a93_0x9401();}(function(_0x519920,_0x4fbd34){const _0x3b5236=a93_0x11c4,_0x36de5a=_0x519920();while(!![]){try{const _0x2b0b6f=-parseInt(_0x3b5236(0x1c5))/0x1*(parseInt(_0x3b5236(0x1d7))/0x2)+-parseInt(_0x3b5236(0x1e0))/0x3*(-parseInt(_0x3b5236(0x1cf))/0x4)+parseInt(_0x3b5236(0x1b9))/0x5*(parseInt(_0x3b5236(0x1d0))/0x6)+-parseInt(_0x3b5236(0x1c4))/0x7*(parseInt(_0x3b5236(0x1d5))/0x8)+parseInt(_0x3b5236(0x1cd))/0x9*(-parseInt(_0x3b5236(0x1c3))/0xa)+-parseInt(_0x3b5236(0x1c9))/0xb+parseInt(_0x3b5236(0x1b7))/0xc;if(_0x2b0b6f===_0x4fbd34)break;else _0x36de5a['push'](_0x36de5a['shift']());}catch(_0x1b7b1d){_0x36de5a['push'](_0x36de5a['shift']());}}}(a93_0x9401,0x29671));Object['defineProperty'](exports,a93_0x1e33b6(0x1d1),{'value':!![]}),exports[a93_0x1e33b6(0x1bf)]=void 0x0;const enc_1=require(a93_0x1e33b6(0x1bb)),mode_1=require(a93_0x1e33b6(0x1dd)),Internal_1=require(a93_0x1e33b6(0x1e2)),enc_2=require(a93_0x1e33b6(0x1cc)),generateIV=_0xa36527=>{const _0x85db2d=a93_0x1e33b6,_0x1c2ec0=new ArrayBuffer(0xc);return new DataView(_0x1c2ec0)[_0x85db2d(0x1c1)](0x8,_0xa36527),new Uint8Array(_0x1c2ec0);},makeNoiseHandler=({keyPair:{private:_0xbdc941,public:_0x10c634},NOISE_HEADER:_0x94f191,mobile:_0x5375db,logger:_0x32d681,routingInfo:_0x4f2837})=>{const _0x1b1587=a93_0x1e33b6,_0x30142e=_0x5d468e=>{const _0x4668ff=a93_0x11c4;!_0x26bede&&(_0x93bef=(0x0,enc_2[_0x4668ff(0x1d4)])(Buffer['concat']([_0x93bef,_0x5d468e])));},_0x3cf36d=_0x4f6ab1=>{const _0x33abd3=a93_0x11c4,_0x281042=(0x0,enc_2[_0x33abd3(0x1bc)])(_0x4f6ab1,_0x2f97fd,generateIV(_0x27e03e),_0x93bef);return _0x27e03e+=0x1,_0x30142e(_0x281042),_0x281042;},_0x7ada4f=_0x39a3d2=>{const _0x393654=a93_0x11c4,_0x4094fb=generateIV(_0x26bede?_0x170c28:_0x27e03e),_0x4b74d2=(0x0,enc_2[_0x393654(0x1e1)])(_0x39a3d2,_0xe3aeb7,_0x4094fb,_0x93bef);return _0x26bede?_0x170c28+=0x1:_0x27e03e+=0x1,_0x30142e(_0x39a3d2),_0x4b74d2;},_0x30f89b=_0x100219=>{const _0x288073=a93_0x11c4,_0x4152fb=(0x0,enc_2[_0x288073(0x1ba)])(Buffer[_0x288073(0x1c7)](_0x100219),0x40,{'salt':_0xfae37d,'info':''});return[_0x4152fb['slice'](0x0,0x20),_0x4152fb[_0x288073(0x1b6)](0x20)];},_0x54cdaa=_0xa66b7a=>{const [_0x349481,_0x599781]=_0x30f89b(_0xa66b7a);_0xfae37d=_0x349481,_0x2f97fd=_0x599781,_0xe3aeb7=_0x599781,_0x170c28=0x0,_0x27e03e=0x0;},_0x1dd312=()=>{const _0x582137=a93_0x11c4,[_0x590f96,_0x2de483]=_0x30f89b(new Uint8Array(0x0));_0x2f97fd=_0x590f96,_0xe3aeb7=_0x2de483,_0x93bef=Buffer[_0x582137(0x1c7)]([]),_0x170c28=0x0,_0x27e03e=0x0,_0x26bede=!![];},_0x1c3a1e=Buffer[_0x1b1587(0x1c7)](mode_1[_0x1b1587(0x1d8)]);let _0x93bef=Buffer[_0x1b1587(0x1c7)](_0x1c3a1e[_0x1b1587(0x1da)]===0x20?_0x1c3a1e:(0x0,enc_2['sha256'])(_0x1c3a1e)),_0xfae37d=_0x93bef,_0x2f97fd=_0x93bef,_0xe3aeb7=_0x93bef,_0x170c28=0x0,_0x27e03e=0x0,_0x26bede=![],_0x26bf94=![],_0x5c4a6a=Buffer['alloc'](0x0);return _0x30142e(_0x94f191),_0x30142e(_0x10c634),{'encrypt':_0x3cf36d,'decrypt':_0x7ada4f,'authenticate':_0x30142e,'mixIntoKey':_0x54cdaa,'finishInit':_0x1dd312,'processHandshake':({serverHello:_0x1569bc},_0x3efb7b)=>{const _0x1f1f2f=_0x1b1587;_0x30142e(_0x1569bc[_0x1f1f2f(0x1b2)]),_0x54cdaa(enc_2['Curve'][_0x1f1f2f(0x1c6)](_0xbdc941,_0x1569bc[_0x1f1f2f(0x1b2)]));const _0x58ede0=_0x7ada4f(_0x1569bc[_0x1f1f2f(0x1dc)]);_0x54cdaa(enc_2[_0x1f1f2f(0x1c0)][_0x1f1f2f(0x1c6)](_0xbdc941,_0x58ede0));const _0x2d6ab1=_0x7ada4f(_0x1569bc[_0x1f1f2f(0x1df)]);if(_0x5375db)enc_1[_0x1f1f2f(0x1ca)][_0x1f1f2f(0x1b4)][_0x1f1f2f(0x1d6)][_0x1f1f2f(0x1be)](_0x2d6ab1);else{const {intermediate:_0x270767}=enc_1[_0x1f1f2f(0x1ca)][_0x1f1f2f(0x1b4)][_0x1f1f2f(0x1be)](_0x2d6ab1),{issuerSerial:_0x2d02bb}=enc_1[_0x1f1f2f(0x1ca)][_0x1f1f2f(0x1b4)]['NoiseCertificate'][_0x1f1f2f(0x1de)][_0x1f1f2f(0x1be)](_0x270767[_0x1f1f2f(0x1d2)]);if(_0x2d02bb!==mode_1[_0x1f1f2f(0x1ce)]['SERIAL'])throw null;}const _0x7e5b14=_0x3cf36d(_0x3efb7b[_0x1f1f2f(0x1b3)]);return _0x54cdaa(enc_2[_0x1f1f2f(0x1c0)][_0x1f1f2f(0x1c6)](_0x3efb7b['private'],_0x1569bc[_0x1f1f2f(0x1b2)])),_0x7e5b14;},'encodeFrame':_0x351972=>{const _0x2cd2cb=_0x1b1587;_0x26bede&&(_0x351972=_0x3cf36d(_0x351972));let _0x1bfa97;_0x4f2837?(_0x1bfa97=Buffer[_0x2cd2cb(0x1cb)](0x7),_0x1bfa97[_0x2cd2cb(0x1b5)]('ED',0x0,'utf8'),_0x1bfa97[_0x2cd2cb(0x1db)](0x0,0x2),_0x1bfa97[_0x2cd2cb(0x1db)](0x1,0x3),_0x1bfa97['writeUint8'](_0x4f2837[_0x2cd2cb(0x1da)]>>0x10,0x4),_0x1bfa97[_0x2cd2cb(0x1b1)](_0x4f2837[_0x2cd2cb(0x1da)]&0xffff,0x5),_0x1bfa97=Buffer['concat']([_0x1bfa97,_0x4f2837,_0x94f191])):_0x1bfa97=Buffer['from'](_0x94f191);const _0x21242e=_0x26bf94?0x0:_0x1bfa97[_0x2cd2cb(0x1c2)],_0x3719d4=Buffer['alloc'](_0x21242e+0x3+_0x351972['byteLength']);return!_0x26bf94&&(_0x3719d4['set'](_0x1bfa97),_0x26bf94=!![]),_0x3719d4[_0x2cd2cb(0x1c8)](_0x351972[_0x2cd2cb(0x1da)]>>0x10,_0x21242e),_0x3719d4[_0x2cd2cb(0x1bd)](0xffff&_0x351972[_0x2cd2cb(0x1da)],_0x21242e+0x1),_0x3719d4[_0x2cd2cb(0x1d3)](_0x351972,_0x21242e+0x3),_0x3719d4;},'decodeFrame':async(_0x130e8f,_0x3b8b0d)=>{const _0x2b85f4=_0x1b1587,_0x2230d9=()=>{const _0x188e2a=a93_0x11c4;if(_0x5c4a6a[_0x188e2a(0x1c2)]>=0x3)return _0x5c4a6a[_0x188e2a(0x1b8)]()<<0x10|_0x5c4a6a[_0x188e2a(0x1d9)](0x1);};_0x5c4a6a=Buffer['concat']([_0x5c4a6a,_0x130e8f]);let _0x468659=_0x2230d9();while(_0x468659&&_0x5c4a6a['length']>=_0x468659+0x3){let _0x1d5265=_0x5c4a6a[_0x2b85f4(0x1b6)](0x3,_0x468659+0x3);_0x5c4a6a=_0x5c4a6a[_0x2b85f4(0x1b6)](_0x468659+0x3);if(_0x26bede){const _0x2b0f5c=_0x7ada4f(_0x1d5265);_0x1d5265=await(0x0,Internal_1['decodeBinaryNode'])(_0x2b0f5c);}_0x3b8b0d(_0x1d5265),_0x468659=_0x2230d9();}}};};exports['makeNoiseHandler']=makeNoiseHandler;