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 3.88 kB
const a37_0x4c7da3=a37_0x4b6b;(function(_0x20dc3f,_0x1728a6){const _0x29f601=a37_0x4b6b,_0x48475a=_0x20dc3f();while(!![]){try{const _0x154e11=parseInt(_0x29f601(0x149))/0x1+-parseInt(_0x29f601(0x14f))/0x2*(-parseInt(_0x29f601(0x13d))/0x3)+-parseInt(_0x29f601(0x155))/0x4+-parseInt(_0x29f601(0x14b))/0x5+-parseInt(_0x29f601(0x14a))/0x6+-parseInt(_0x29f601(0x15d))/0x7+parseInt(_0x29f601(0x15c))/0x8;if(_0x154e11===_0x1728a6)break;else _0x48475a['push'](_0x48475a['shift']());}catch(_0x7f522a){_0x48475a['push'](_0x48475a['shift']());}}}(a37_0x4b34,0x5938a));function a37_0x4b34(){const _0x27235f=['encode','CURRENT_VERSION','170kggZvd','calculateSignature','iteration','from','ciphertext','decode','2424716ONuwGT','Invalid\x20signature!','getSignature','./protobufs','serialize','getType','messageVersion','9786976FNvDeT','3147956KRHkTU','13737KBAodW','SenderKeyMessage','finish','signature','serialized','./ciphertext_message','SIGNATURE_LENGTH','keyId','getKeyId','slice','concat','verifySignature','699747uCtpxj','1587570aUkNZU','3132010KJkxzD','getIteration'];a37_0x4b34=function(){return _0x27235f;};return a37_0x4b34();}const CiphertextMessage=require(a37_0x4c7da3(0x142)),curve=require('super-libsignal/src/curve'),protobufs=require(a37_0x4c7da3(0x158));class SenderKeyMessage extends CiphertextMessage{[a37_0x4c7da3(0x143)]=0x40;constructor(_0x20f7b8=null,_0x5e4bc5=null,_0x57460f=null,_0x457e81=null,_0x59a2b4=null){const _0x48a356=a37_0x4c7da3;super();if(_0x59a2b4){const _0x1dcf54=_0x59a2b4[0x0],_0x2055d3=_0x59a2b4[_0x48a356(0x146)](0x1,_0x59a2b4['length']-this[_0x48a356(0x143)]),_0x4f9397=_0x59a2b4['slice'](-0x1*this[_0x48a356(0x143)]),_0x211626=protobufs[_0x48a356(0x13e)][_0x48a356(0x154)](_0x2055d3)['toJSON']();_0x211626[_0x48a356(0x153)]=Buffer[_0x48a356(0x152)](_0x211626[_0x48a356(0x153)],'base64'),this[_0x48a356(0x141)]=_0x59a2b4,this[_0x48a356(0x15b)]=(_0x1dcf54&0xff)>>0x4,this[_0x48a356(0x144)]=_0x211626['id'],this[_0x48a356(0x151)]=_0x211626['iteration'],this['ciphertext']=_0x211626[_0x48a356(0x153)],this[_0x48a356(0x140)]=_0x4f9397;}else{const _0x53324f=((this[_0x48a356(0x14e)]<<0x4|this[_0x48a356(0x14e)])&0xff)%0x100;_0x57460f=Buffer['from'](_0x57460f);const _0xd473fe=protobufs[_0x48a356(0x13e)][_0x48a356(0x14d)](protobufs['SenderKeyMessage']['create']({'id':_0x20f7b8,'iteration':_0x5e4bc5,'ciphertext':_0x57460f}))[_0x48a356(0x13f)](),_0x401496=this[_0x48a356(0x157)](_0x457e81,Buffer[_0x48a356(0x147)]([Buffer[_0x48a356(0x152)]([_0x53324f]),_0xd473fe]));this[_0x48a356(0x141)]=Buffer[_0x48a356(0x147)]([Buffer['from']([_0x53324f]),_0xd473fe,Buffer[_0x48a356(0x152)](_0x401496)]),this[_0x48a356(0x15b)]=this[_0x48a356(0x14e)],this[_0x48a356(0x144)]=_0x20f7b8,this['iteration']=_0x5e4bc5,this[_0x48a356(0x153)]=_0x57460f,this[_0x48a356(0x140)]=_0x401496;}}[a37_0x4c7da3(0x145)](){const _0x4977c7=a37_0x4c7da3;return this[_0x4977c7(0x144)];}[a37_0x4c7da3(0x14c)](){return this['iteration'];}['getCipherText'](){return this['ciphertext'];}[a37_0x4c7da3(0x148)](_0x3f118d){const _0x35f87d=a37_0x4c7da3,_0x59f972=this['serialized']['slice'](0x0,this[_0x35f87d(0x141)]['length']-this[_0x35f87d(0x143)]),_0x5ed30e=this['serialized'][_0x35f87d(0x146)](-0x1*this[_0x35f87d(0x143)]),_0x174363=curve['verifySignature'](_0x3f118d,_0x59f972,_0x5ed30e);if(!_0x174363)throw new Error(_0x35f87d(0x156));}[a37_0x4c7da3(0x157)](_0x3a3b2a,_0x1ea6d0){const _0x5c7e4c=a37_0x4c7da3,_0x3c542f=Buffer[_0x5c7e4c(0x152)](curve[_0x5c7e4c(0x150)](_0x3a3b2a,_0x1ea6d0));return _0x3c542f;}[a37_0x4c7da3(0x159)](){const _0x2a5cf8=a37_0x4c7da3;return this[_0x2a5cf8(0x141)];}[a37_0x4c7da3(0x15a)](){return 0x4;}}function a37_0x4b6b(_0x3ef300,_0x4e1dcb){const _0x4b34df=a37_0x4b34();return a37_0x4b6b=function(_0x4b6b03,_0x3f5b5d){_0x4b6b03=_0x4b6b03-0x13d;let _0x5d2864=_0x4b34df[_0x4b6b03];return _0x5d2864;},a37_0x4b6b(_0x3ef300,_0x4e1dcb);}module['exports']=SenderKeyMessage;