@narraleaf/encryption 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/constants.d.ts +7 -0
- package/dist/constants.js +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -0
- package/dist/native.d.ts +9 -0
- package/dist/native.js +1 -0
- package/dist/runtime.d.ts +12 -0
- package/dist/runtime.js +1 -0
- package/package.json +44 -0
- package/prebuilds/darwin-arm64/nlcrypto.node +0 -0
- package/prebuilds/darwin-x64/nlcrypto.node +0 -0
- package/prebuilds/linux-x64/nlcrypto.node +0 -0
- package/prebuilds/win32-x64/nlcrypto.node +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const RUNTIME_KEY_PLACEHOLDER = "__NLS_ENC_KEY_PLACEHOLDER__";
|
|
2
|
+
export declare const RUNTIME_SUPPORT_FILENAME = "nlcrypto.node";
|
|
3
|
+
export declare const RUNTIME_BUNDLE_FILENAME = "content.dat";
|
|
4
|
+
export declare const BUNDLE_VERSION = 1;
|
|
5
|
+
export declare const BUNDLE_IV_LEN = 16;
|
|
6
|
+
export declare const BUNDLE_HEADER_LEN: number;
|
|
7
|
+
export declare const BUNDLE_TRAILER_LEN = 8;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var _0x401def=_0x6df9;(function(_0x58cd35,_0x595cdb){var _0x432c0=_0x6df9,_0x4904ec=_0x58cd35();while(!![]){try{var _0x4e7181=parseInt(_0x432c0(0x17d))/(0x736+-0x11d2+0xa9d*0x1)+parseInt(_0x432c0(0x180))/(0x2336+-0x61*-0x2+-0x23f6*0x1)+-parseInt(_0x432c0(0x17e))/(-0x120b+-0x459+0x1667)+-parseInt(_0x432c0(0x18c))/(-0x2*-0xbd9+-0x1eb3+0x705)+-parseInt(_0x432c0(0x185))/(-0x135*-0xa+-0x3c8*0x1+-0x845)+-parseInt(_0x432c0(0x17c))/(-0x2157+-0x20ed+0x424a)+-parseInt(_0x432c0(0x183))/(-0x562+-0x19*-0x1+0x550)*(-parseInt(_0x432c0(0x18d))/(-0x59f+0x6a6+-0xff));if(_0x4e7181===_0x595cdb)break;else _0x4904ec['push'](_0x4904ec['shift']());}catch(_0x51b16e){_0x4904ec['push'](_0x4904ec['shift']());}}}(_0x3504,0x1*0x84551+0xc9fb9*-0x1+0xf1fe2));function _0x6df9(_0x2c45c6,_0x3177dd){_0x2c45c6=_0x2c45c6-(-0x561*-0x5+-0x2*0x122c+0xaef);var _0x4f5b90=_0x3504();var _0x17cc37=_0x4f5b90[_0x2c45c6];if(_0x6df9['EjmWjB']===undefined){var _0x337af4=function(_0x2446b8){var _0x584548='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x307463='',_0x5227fd='';for(var _0x102b84=0x11*-0x22d+0xa07+0x22*0xcb,_0x41dbff,_0x4b9377,_0x3c4bdf=-0x11f7+-0x136c+0x233*0x11;_0x4b9377=_0x2446b8['charAt'](_0x3c4bdf++);~_0x4b9377&&(_0x41dbff=_0x102b84%(-0x733*-0x3+-0x2d5+0x5*-0x3c0)?_0x41dbff*(-0xdbf+-0x9db*0x2+-0x1*-0x21b5)+_0x4b9377:_0x4b9377,_0x102b84++%(0xf*0x2f+-0xb*-0x193+-0x140e))?_0x307463+=String['fromCharCode'](-0x5a2+0x9*0x3e1+-0x1*0x1c48&_0x41dbff>>(-(-0x14ba+-0x14ba+0x2976)*_0x102b84&-0x12d3+-0xbcb+-0x4a*-0x6a)):-0x109f+-0x1dc5+0x2e64){_0x4b9377=_0x584548['indexOf'](_0x4b9377);}for(var _0x387d93=-0x1*0x10fb+0x1be5+-0x7f*0x16,_0x19f05e=_0x307463['length'];_0x387d93<_0x19f05e;_0x387d93++){_0x5227fd+='%'+('00'+_0x307463['charCodeAt'](_0x387d93)['toString'](-0x16f*0x8+0xd2+0x3*0x392))['slice'](-(-0x10*-0xd1+-0x100f+0x301));}return decodeURIComponent(_0x5227fd);};_0x6df9['PpsmrJ']=_0x337af4,_0x6df9['nRmNMo']={},_0x6df9['EjmWjB']=!![];}var _0x5e2015=_0x4f5b90[-0x734+0x1*-0x8e6+0x12*0xe5],_0x5d6f5b=_0x2c45c6+_0x5e2015,_0x37e940=_0x6df9['nRmNMo'][_0x5d6f5b];return!_0x37e940?(_0x17cc37=_0x6df9['PpsmrJ'](_0x17cc37),_0x6df9['nRmNMo'][_0x5d6f5b]=_0x17cc37):_0x17cc37=_0x37e940,_0x17cc37;}Object[_0x401def(0x187)](exports,_0x401def(0x17f),{'value':!![]}),exports[_0x401def(0x182)]=exports[_0x401def(0x189)]=exports[_0x401def(0x184)]=exports[_0x401def(0x18a)]=exports[_0x401def(0x186)]=exports[_0x401def(0x181)]=exports[_0x401def(0x18b)]=void(0x29*0x74+-0xc11+-0x683),exports[_0x401def(0x18b)]='__NLS_ENC_KEY_PLACEHOLDER__',exports[_0x401def(0x181)]='nlcrypto.node',exports[_0x401def(0x186)]=_0x401def(0x188),exports[_0x401def(0x18a)]=0xc51*-0x3+-0x1*0x52a+-0x150f*-0x2,exports[_0x401def(0x184)]=-0x16*0x52+0xd60+-0x644,exports[_0x401def(0x189)]=-0x4*-0x44b+0xf*-0x259+0x2c*0x69+exports[_0x401def(0x184)],exports[_0x401def(0x182)]=0x105d+-0x833+-0x6*0x15b;function _0x3504(){var _0xc7867a=['qLvoreXfx0Lwx0XftG','mZC0ntCZnxL2DxvtqW','uLvoveLnrv9cvu5etevFrKLmru5btuu','zgvMAw5LuhjVCgvYDhK','y29UDgvUDc5Kyxq','qLvoreXfx0HfqurfuL9mru4','qLvoreXfx1zfuLnjt04','uLvoveLnrv9lrvLFueXbq0vit0Xervi','mJK5nJe4meHjCfH0Dq','nda4mtzbu2LkueC','nJy5nZG5me1mEufsyq','ndGXntu2B2DLzwPV','mtyXmJHZqu5RyKO','x19LC01VzhvSzq','mtCZotuZnfnuEMXpBa','uLvoveLnrv9tvvbqt1jux0zjtevoqu1f','qLvoreXfx1rsquLmrvjFtevo','mJCWounAwuv0vW'];_0x3504=function(){return _0xc7867a;};return _0x3504();}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { RUNTIME_KEY_PLACEHOLDER, RUNTIME_SUPPORT_FILENAME, RUNTIME_BUNDLE_FILENAME } from "./constants";
|
|
2
|
+
export declare function derivePackEncryptionKey(machineSecret: Buffer, projectSalt: Buffer): string;
|
|
3
|
+
export declare function obfuscateKey(rawKey: Buffer): string;
|
|
4
|
+
export declare function encryptBuffer(plain: Buffer, packKey: string): Buffer;
|
|
5
|
+
export declare function isProtectedPayload(buffer: Buffer): boolean;
|
|
6
|
+
export declare function runtimeSupportPath(): string;
|
|
7
|
+
export interface SealedBundleWriter {
|
|
8
|
+
add(name: string, data: Buffer): Promise<void>;
|
|
9
|
+
finalize(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare function createSealedBundle(filePath: string, packKey: string): Promise<SealedBundleWriter>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const _0x42cb36=_0x54c2;(function(_0x20fe4e,_0x18b392){const _0x28d784=_0x54c2,_0x37947c=_0x20fe4e();while(!![]){try{const _0x4b680e=parseInt(_0x28d784(0x1b3))/(0x2*-0x1085+0xc0b+0x150*0x10)*(-parseInt(_0x28d784(0x1df))/(0x8b*0x20+-0x165b+0x1*0x4fd))+-parseInt(_0x28d784(0x1db))/(0x1970+0x25*0xfb+-0x2c*0x167)+parseInt(_0x28d784(0x1d0))/(-0xcf6+0x4*0x269+0x7*0x7a)*(-parseInt(_0x28d784(0x1da))/(0x435+0x1fbd+-0x23ed))+-parseInt(_0x28d784(0x1bb))/(-0x70*-0x16+0x14*0x95+-0x153e)+parseInt(_0x28d784(0x1de))/(-0x1409*0x1+0x78*0x1f+0x588)+parseInt(_0x28d784(0x1eb))/(0x1*0x1d23+0x2f*-0x26+-0x1621)+parseInt(_0x28d784(0x1cb))/(0xf85+0x335*-0x7+-0x6f7*-0x1)*(parseInt(_0x28d784(0x1e9))/(0x1*-0xff1+-0x3*-0xb6f+-0x1252));if(_0x4b680e===_0x18b392)break;else _0x37947c['push'](_0x37947c['shift']());}catch(_0x321f52){_0x37947c['push'](_0x37947c['shift']());}}}(_0x3c81,-0x165e87+0x8c0af*0x1+0x71f*0x3d7));var __importDefault=this&&this[_0x42cb36(0x1b4)]||function(_0x38041a){const _0x4bde8b=_0x42cb36;return _0x38041a&&_0x38041a[_0x4bde8b(0x1dc)]?_0x38041a:{'default':_0x38041a};};function _0x3c81(){const _0x2335dc=['qLvoreXfx0Lwx0XftG','qLvoreXfx0HfqurfuL9mru4','DhjHBNnMB3jT','z1PfugG','y2f0y2G','mZiXmde1otzxA0nAy2G','lI9UyxrPDMu','uLvoveLnrv9tvvbqt1jux0zjtevoqu1f','D3jPDgu','ChjVDg90ExbL','mtjWvvLntfy','AxnfBMnYExb0zwq','zgvMAw5LuhjVCgvYDhK','zNmVChjVBwLZzxm','qvvNEeS','y3j5ChrV','CMfUzg9TqNL0zxm','zw5JCNLWDa','t3bXzK0','CMvZB2X2zu5HDgL2zujPBMfYEvbHDgG','nJe3oty1shzMquP3','mZi1mdi3nwryDfz4qW','x19LC01VzhvSzq','BgvUz3rO','mty4otCYm3rTBM16Ba','ndy2zMrMt0X0','D3jPDgvcAwDvsw50nJrmrq','zgvYAxzLugfJA0vUy3j5ChrPB25lzxK','zhvWBgLJyxrLihnLywXLzcbIDw5KBguGzw50CNK6ia','CNvUDgLTzvn1ChbVCNrqyxrO','ExDitLe','B2jMDxnJyxrLs2v5','C2vHBgvKigj1BMrSzsb3CML0zsbTywrLig5VihbYB2DYzxnZ','y2XVC2u','AgTKzLn5BMm','mtbOq0fkq2e','BMXWywnRlwTLEs12mq','ndiYmZK1mMrKDhz2Aq','ywXSB2m','t2D1thu','Bg9Hze5HDgL2zunVzgvJrNjVBq','D0vwDwW','B3bLBG','AgfZt3DUuhjVCgvYDhK','y29WEq','uLvoveLnrv9lrvLFueXbq0vit0Xervi','zgXHr0K','mJKWm3Pur0XUCa','x19PBxbVCNrezwzHDwX0','uLvoveLnrv9cvu5etevFrKLmru5btuu','zw5JCNLWDej1zMzLCG','zNjVBq','qLvoreXfx1rsquLmrvjFtevo','qLvoreXfx1zfuLnjt04','DxrMltG','nZGZntK0nMTyuKnsDq','C2HHmJu2','C3rYAw5NAwz5','y2fSBa','AxnqCM90zwn0zwrqyxLSB2fK','zMLSBa','rhPerwy','y3jLyxrLu2vHBgvKqNvUzgXL','wLHTtum','C2vHBgvKigj1BMrSzsbHBhjLywr5igzPBMfSAxPLza','zgvMyxvSDa'];_0x3c81=function(){return _0x2335dc;};return _0x3c81();}Object[_0x42cb36(0x1d2)](exports,_0x42cb36(0x1dc),{'value':!![]}),exports[_0x42cb36(0x1b5)]=exports[_0x42cb36(0x1cd)]=exports[_0x42cb36(0x1f3)]=void(-0x1*0x12b5+-0x17c1+0x2a76*0x1),exports[_0x42cb36(0x1e1)]=derivePackEncryptionKey,exports[_0x42cb36(0x1e5)]=obfuscateKey,exports[_0x42cb36(0x1b6)]=encryptBuffer,exports[_0x42cb36(0x1bf)]=isProtectedPayload,exports[_0x42cb36(0x1e3)]=runtimeSupportPath,exports[_0x42cb36(0x1c2)]=createSealedBundle;const crypto_1=__importDefault(require(_0x42cb36(0x1d5))),promises_1=__importDefault(require(_0x42cb36(0x1d3))),native_1=require(_0x42cb36(0x1cc)),constants_1=require('./constants');var constants_2=require('./constants');Object[_0x42cb36(0x1d2)](exports,_0x42cb36(0x1f3),{'enumerable':!![],'get':function(){const _0x3948d3=_0x42cb36;return constants_2[_0x3948d3(0x1f3)];}}),Object[_0x42cb36(0x1d2)](exports,_0x42cb36(0x1cd),{'enumerable':!![],'get':function(){const _0x20c200=_0x42cb36;return constants_2[_0x20c200(0x1cd)];}}),Object[_0x42cb36(0x1d2)](exports,_0x42cb36(0x1b5),{'enumerable':!![],'get':function(){const _0x5cc518=_0x42cb36;return constants_2[_0x5cc518(0x1b5)];}});const KEY_LENGTH=-0x1*0x6b8+-0x21ae+0x2886;let codec=null;function native(){const _0x197d65=_0x42cb36;return!codec&&(codec=(-0x86+0x25ac+-0x6*0x631,native_1[_0x197d65(0x1ee)])((-0x1d0f+-0x75d+0x246c,native_1[_0x197d65(0x1d9)])())),codec;}function deriveRawKey(_0x384d28,_0x3e16bd){const _0x32f396=_0x42cb36,_0x66a983={'OguLu':_0x32f396(0x1bc),'DzDEf':_0x32f396(0x1ea)};return Buffer[_0x32f396(0x1b7)](crypto_1[_0x32f396(0x1c5)][_0x32f396(0x1e8)](_0x66a983[_0x32f396(0x1ed)],_0x384d28,_0x3e16bd,_0x66a983[_0x32f396(0x1c1)],KEY_LENGTH));}function derivePackEncryptionKey(_0x2b9f59,_0x3510f1){const _0x38599e=_0x42cb36,_0x2ef723=deriveRawKey(_0x2b9f59,_0x3510f1);try{return native()[_0x38599e(0x1e5)](_0x2ef723);}finally{_0x2ef723[_0x38599e(0x1c0)](-0x110c+-0x4*-0x3be+-0x7*-0x4c);}}function obfuscateKey(_0x2e69a4){const _0x4563ad=_0x42cb36;return native()[_0x4563ad(0x1e5)](_0x2e69a4);}function encryptBuffer(_0x3e24d4,_0x1664b4){const _0x230cfd=_0x42cb36,_0x5c458e={'ywHNQ':function(_0x385145){return _0x385145();}};return _0x5c458e[_0x230cfd(0x1e4)](native)[_0x230cfd(0x1d7)](_0x3e24d4,_0x1664b4);}function _0x54c2(_0x1f8870,_0x2866e1){_0x1f8870=_0x1f8870-(0x22c*0x3+-0x17cc+0x12fa*0x1);const _0xfdf68c=_0x3c81();let _0x47b2be=_0xfdf68c[_0x1f8870];if(_0x54c2['PDmgQo']===undefined){var _0x43e8ba=function(_0x3f92a1){const _0x2b2c07='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x25f3e8='',_0x531086='';for(let _0x368ae0=-0x1*-0x88a+-0x167*-0x2+-0xb58,_0x4b1c3f,_0xfe86c7,_0x25b2a2=0xe9*0x18+0x6*0x34d+-0x6*0x6f1;_0xfe86c7=_0x3f92a1['charAt'](_0x25b2a2++);~_0xfe86c7&&(_0x4b1c3f=_0x368ae0%(0x1*0x623+-0x25d5+0x1fb6)?_0x4b1c3f*(-0x6c+0x1b84+-0x1ad8)+_0xfe86c7:_0xfe86c7,_0x368ae0++%(-0x1166+0xf0a+0x260))?_0x25f3e8+=String['fromCharCode'](0x1*-0xd45+-0x152c+-0x12*-0x1f8&_0x4b1c3f>>(-(-0x14*0x104+-0x108a+0x24dc)*_0x368ae0&-0x803*0x1+-0x7*0x28+-0x13*-0x7b)):0xb39+-0xc73+-0x9d*-0x2){_0xfe86c7=_0x2b2c07['indexOf'](_0xfe86c7);}for(let _0x145381=-0x7fa+0x11f3+-0x9f9,_0x9b8ae1=_0x25f3e8['length'];_0x145381<_0x9b8ae1;_0x145381++){_0x531086+='%'+('00'+_0x25f3e8['charCodeAt'](_0x145381)['toString'](0x1*0x601+-0x172+-0x47f))['slice'](-(0x4*-0x98d+0xbc1+-0x209*-0xd));}return decodeURIComponent(_0x531086);};_0x54c2['krbEOO']=_0x43e8ba,_0x54c2['RTocWi']={},_0x54c2['PDmgQo']=!![];}const _0x628c73=_0xfdf68c[0x2534+-0x21f*-0xf+-0x4505],_0x2a9aed=_0x1f8870+_0x628c73,_0xad9627=_0x54c2['RTocWi'][_0x2a9aed];return!_0xad9627?(_0x47b2be=_0x54c2['krbEOO'](_0x47b2be),_0x54c2['RTocWi'][_0x2a9aed]=_0x47b2be):_0x47b2be=_0xad9627,_0x47b2be;}function isProtectedPayload(_0x5c166f){const _0x3cd49b=_0x42cb36;return native()[_0x3cd49b(0x1d1)](_0x5c166f);}function runtimeSupportPath(){const _0x3d6926=_0x42cb36;return(-0xc86+0x1c82+-0xffc,native_1[_0x3d6926(0x1d9)])();}async function createSealedBundle(_0x4f65fa,_0x80019b){const _0x2f12c0=_0x42cb36,_0x4c67ee={'gZEPh':function(_0x2938e3,_0x58bde5){return _0x2938e3(_0x58bde5);},'OpqfM':function(_0x535db9,_0x104570,_0x36bde3){return _0x535db9(_0x104570,_0x36bde3);},'AUgxK':function(_0x3b6f25,_0x559795,_0x38883f){return _0x3b6f25(_0x559795,_0x38883f);}},_0x2cadc1=crypto_1[_0x2f12c0(0x1c5)][_0x2f12c0(0x1d6)](constants_1[_0x2f12c0(0x1c6)]),_0x29b03f=await promises_1[_0x2f12c0(0x1c5)][_0x2f12c0(0x1f0)](_0x4f65fa,'w'),_0x561800=Buffer[_0x2f12c0(0x1ec)](constants_1[_0x2f12c0(0x1c7)]);_0x561800[0xcc0+-0x5e0*-0x2+-0x1880]=constants_1[_0x2f12c0(0x1b9)],_0x2cadc1[_0x2f12c0(0x1f2)](_0x561800,-0x172e+0x463*-0x2+0x1ff5);try{await _0x29b03f[_0x2f12c0(0x1ce)](_0x561800);}catch(_0xf8fa37){await _0x29b03f[_0x2f12c0(0x1e7)]()[_0x2f12c0(0x1ca)](()=>undefined);throw _0xf8fa37;}const _0x20c723={};let _0xc5feef=-0xc*-0x1cc+-0xad1+-0x395*0x3,_0x2cef0c=![];const _0x504adf=async _0x567523=>{const _0x177843=_0x2f12c0;_0x2cef0c=!![],await _0x29b03f[_0x177843(0x1e7)]()[_0x177843(0x1ca)](()=>undefined);throw _0x567523;};return{async 'add'(_0x17af2a,_0x3babde){const _0x523bc6=_0x2f12c0;if(_0x2cef0c)throw new Error(_0x523bc6(0x1c4));if(Object[_0x523bc6(0x1cf)][_0x523bc6(0x1f1)][_0x523bc6(0x1be)](_0x20c723,_0x17af2a))throw new Error(_0x523bc6(0x1e2)+_0x17af2a);try{const _0x1bf035=native()[_0x523bc6(0x1c8)](_0x3babde,_0x80019b,_0x2cadc1,_0xc5feef);await writeAll(_0x29b03f,_0x1bf035),_0x20c723[_0x17af2a]=[_0xc5feef,_0x3babde[_0x523bc6(0x1dd)]],_0xc5feef+=_0x3babde[_0x523bc6(0x1dd)];}catch(_0x389d33){return _0x4c67ee[_0x523bc6(0x1c9)](_0x504adf,_0x389d33);}},async 'finalize'(){const _0x1fdcc9=_0x2f12c0;if(_0x2cef0c)return;_0x2cef0c=!![];try{const _0xf86392=Buffer[_0x1fdcc9(0x1b7)](JSON[_0x1fdcc9(0x1bd)](_0x20c723),_0x1fdcc9(0x1ba)),_0x372fc9=native()[_0x1fdcc9(0x1c8)](_0xf86392,_0x80019b,_0x2cadc1,_0xc5feef);await _0x4c67ee[_0x1fdcc9(0x1d8)](writeAll,_0x29b03f,_0x372fc9);const _0x51307e=Buffer[_0x1fdcc9(0x1ec)](constants_1[_0x1fdcc9(0x1b8)]);_0x51307e[_0x1fdcc9(0x1e0)](BigInt(_0xf86392[_0x1fdcc9(0x1dd)])),await _0x4c67ee[_0x1fdcc9(0x1d4)](writeAll,_0x29b03f,_0x51307e);}catch(_0x59bb20){await _0x29b03f[_0x1fdcc9(0x1e7)]()[_0x1fdcc9(0x1ca)](()=>undefined);throw _0x59bb20;}await _0x29b03f[_0x1fdcc9(0x1e7)]();}};}async function writeAll(_0x14826c,_0x198ba7){const _0x229cea=_0x42cb36,_0x58e6a8={'ZXmMC':function(_0x5639e0,_0x1452b1){return _0x5639e0<_0x1452b1;},'wEVul':function(_0x2b0dc0,_0x2746a3){return _0x2b0dc0-_0x2746a3;},'dlaGI':_0x229cea(0x1e6)};let _0x4e7e0c=0x5*-0x93+-0x1*0x26dd+0x2*0x14de;while(_0x58e6a8[_0x229cea(0x1c3)](_0x4e7e0c,_0x198ba7[_0x229cea(0x1dd)])){const {bytesWritten:_0x2e77ac}=await _0x14826c[_0x229cea(0x1ce)](_0x198ba7,_0x4e7e0c,_0x58e6a8[_0x229cea(0x1ef)](_0x198ba7[_0x229cea(0x1dd)],_0x4e7e0c));if(_0x2e77ac<=-0x9*0x173+0x82+-0xc89*-0x1)throw new Error(_0x58e6a8[_0x229cea(0x1b2)]);_0x4e7e0c+=_0x2e77ac;}}
|
package/dist/native.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface NativeCodec {
|
|
2
|
+
isEncrypted(buffer: Buffer): boolean;
|
|
3
|
+
obfuscateKey(rawKey: Buffer): string;
|
|
4
|
+
encrypt(plain: Buffer, obfKey: string): Buffer;
|
|
5
|
+
decrypt(envelope: Buffer, obfKey: string): Buffer;
|
|
6
|
+
transform(data: Buffer, obfKey: string, iv: Buffer, streamOffset: number): Buffer;
|
|
7
|
+
}
|
|
8
|
+
export declare function resolveNativeBinaryPath(): string;
|
|
9
|
+
export declare function loadNativeCodecFrom(binaryPath: string): NativeCodec;
|
package/dist/native.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const _0x15f1a6=_0x569a;(function(_0x1bc0fe,_0x55c39b){const _0x6591c5=_0x569a,_0x5c0323=_0x1bc0fe();while(!![]){try{const _0x10c9ad=-parseInt(_0x6591c5(0x74))/(0x11*0x98+0x2336*-0x1+0x191f)+parseInt(_0x6591c5(0x7d))/(0x119c+0x1bd5+0x3*-0xf25)+-parseInt(_0x6591c5(0x66))/(0x1b+-0x54b*0x1+0x533)+-parseInt(_0x6591c5(0x73))/(0xa6*-0x2+-0x1bdb+-0x83*-0x39)+-parseInt(_0x6591c5(0x7a))/(-0x156a*-0x1+0x2184+-0x36e9)*(parseInt(_0x6591c5(0x6a))/(-0x18a+-0x1*-0x911+-0x781))+-parseInt(_0x6591c5(0x78))/(-0x1654+0x5*-0x287+0x1*0x22fe)*(parseInt(_0x6591c5(0x75))/(0xdf9+0xa10+-0x1801*0x1))+parseInt(_0x6591c5(0x81))/(0x8*-0x3df+0x340*-0x5+0x2f41);if(_0x10c9ad===_0x55c39b)break;else _0x5c0323['push'](_0x5c0323['shift']());}catch(_0x4b8ca9){_0x5c0323['push'](_0x5c0323['shift']());}}}(_0x2e80,-0x63d*0xef+-0x65b*0x71+0xd4251));var __importDefault=this&&this[_0x15f1a6(0x76)]||function(_0x4db75a){const _0x248145=_0x15f1a6;return _0x4db75a&&_0x4db75a[_0x248145(0x77)]?_0x4db75a:{'default':_0x4db75a};};Object[_0x15f1a6(0x85)](exports,_0x15f1a6(0x77),{'value':!![]}),exports[_0x15f1a6(0x7c)]=resolveNativeBinaryPath,exports[_0x15f1a6(0x82)]=loadNativeCodecFrom;const fs_1=__importDefault(require('fs')),path_1=__importDefault(require(_0x15f1a6(0x7f)));function candidatePaths(){const _0x5a2db9=_0x15f1a6,_0x4ed823={'bOfBW':_0x5a2db9(0x6b),'eSnZI':_0x5a2db9(0x80),'kHyqm':_0x5a2db9(0x79)},_0x59444d=process[_0x5a2db9(0x71)]+'-'+process[_0x5a2db9(0x83)],_0x54b6a3=path_1[_0x5a2db9(0x7b)][_0x5a2db9(0x7e)](__dirname,'..');return[path_1[_0x5a2db9(0x7b)][_0x5a2db9(0x7e)](_0x54b6a3,_0x4ed823[_0x5a2db9(0x67)],_0x59444d,'nlcrypto.node'),path_1[_0x5a2db9(0x7b)][_0x5a2db9(0x7e)](_0x54b6a3,_0x4ed823[_0x5a2db9(0x72)],_0x4ed823[_0x5a2db9(0x68)],'nlcrypto.node')];}function _0x2e80(){const _0x19ae23=['mta5mZqZohf0yMnnyq','AM9PBG','Cgf0Aa','yNvPBgq','mtm4mdK4ntjeDevKAwy','Bg9Hze5HDgL2zunVzgvJrNjVBq','yxjJAa','zxHPC3rZu3LUyW','zgvMAw5LuhjVCgvYDhK','mtCZmZm5mvDlDeX1Bq','yK9MqLC','A0H5Cw0','zgXVCgvU','nJa3ogDICxnlqG','ChjLyNvPBgrZ','DerZugC','qg5HCNjHBgvHzI9LBMnYExb0Aw9UoIbUBYbUyxrPDMuGyMLUyxj5igzVCIa','q2HLy2TLzdOkica','zxHWB3j0CW','cIaG','CgXHDgzVCM0','zvnUwKK','mJa3ndC4mfH1y2r5BG','mty2nJnPExriuM8','odi0Ag1ftKL5','x19PBxbVCNrezwzHDwX0','x19LC01VzhvSzq','nJq3nxz4vwDMwG','uMvSzwfZzq','mJGXmffsEvfODq','zgvMyxvSDa','CMvZB2X2zu5HDgL2zujPBMfYEvbHDgG'];_0x2e80=function(){return _0x19ae23;};return _0x2e80();}function _0x569a(_0x2e6118,_0x5aa51f){_0x2e6118=_0x2e6118-(-0x1247+-0x859*-0x1+0x4*0x295);const _0x24a429=_0x2e80();let _0x6ef110=_0x24a429[_0x2e6118];if(_0x569a['VMzEQJ']===undefined){var _0x2f50d2=function(_0x548b3a){const _0x1164a5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3b1caf='',_0x19f58c='';for(let _0x35c6b7=0x1a18+-0x848+0x28*-0x72,_0x10ec05,_0x7afd9f,_0xedbe42=0x10ed+0x10*0xa+-0x118d;_0x7afd9f=_0x548b3a['charAt'](_0xedbe42++);~_0x7afd9f&&(_0x10ec05=_0x35c6b7%(0x959+0x1ed6+0x317*-0xd)?_0x10ec05*(0x5c*0x53+-0x17ec+-0x5a8)+_0x7afd9f:_0x7afd9f,_0x35c6b7++%(-0x24af+0x1651*0x1+-0x20e*-0x7))?_0x3b1caf+=String['fromCharCode'](-0x2*0xc41+0x3*-0xa9f+0x395e&_0x10ec05>>(-(-0x1*0x1dff+-0x1729+0x352a)*_0x35c6b7&-0x91*0x1+0x206d+-0x146*0x19)):0x176f+-0xf5c+-0x813){_0x7afd9f=_0x1164a5['indexOf'](_0x7afd9f);}for(let _0x2c3700=-0x84*-0x9+-0xacb+0x9*0xaf,_0x23794c=_0x3b1caf['length'];_0x2c3700<_0x23794c;_0x2c3700++){_0x19f58c+='%'+('00'+_0x3b1caf['charCodeAt'](_0x2c3700)['toString'](0x762+-0x1b57+0x1405*0x1))['slice'](-(-0x1f58+0x407*0x3+0x1345*0x1));}return decodeURIComponent(_0x19f58c);};_0x569a['LoZKFa']=_0x2f50d2,_0x569a['GPlmmg']={},_0x569a['VMzEQJ']=!![];}const _0x2833dd=_0x24a429[-0x6*-0x6e+0x1429+-0x16bd*0x1],_0xba07d9=_0x2e6118+_0x2833dd,_0x22b441=_0x569a['GPlmmg'][_0xba07d9];return!_0x22b441?(_0x6ef110=_0x569a['LoZKFa'](_0x6ef110),_0x569a['GPlmmg'][_0xba07d9]=_0x6ef110):_0x6ef110=_0x22b441,_0x6ef110;}function resolveNativeBinaryPath(){const _0x13ae5c=_0x15f1a6,_0x32d59c={'tDsPg':function(_0x3e675f){return _0x3e675f();}},_0x484bdc=_0x32d59c[_0x13ae5c(0x6c)](candidatePaths);for(const _0x24fe14 of _0x484bdc){if(fs_1[_0x13ae5c(0x7b)][_0x13ae5c(0x84)](_0x24fe14))return _0x24fe14;}throw new Error(_0x13ae5c(0x6d)+process[_0x13ae5c(0x71)]+'-'+process[_0x13ae5c(0x83)]+'.\x20'+(_0x13ae5c(0x6e)+_0x484bdc[_0x13ae5c(0x7e)](_0x13ae5c(0x70))));}function loadNativeCodecFrom(_0x20abd9){const _0x465ac3=_0x15f1a6,_0x3f8663={'exports':{}};return process[_0x465ac3(0x69)](_0x3f8663,_0x20abd9),_0x3f8663[_0x465ac3(0x6f)];}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type NativeCodec } from "./native";
|
|
2
|
+
export { RUNTIME_KEY_PLACEHOLDER, RUNTIME_SUPPORT_FILENAME, RUNTIME_BUNDLE_FILENAME } from "./constants";
|
|
3
|
+
export type { NativeCodec as RuntimeReader } from "./native";
|
|
4
|
+
export declare function isProtectedPayload(buffer: Buffer): boolean;
|
|
5
|
+
export declare function createRuntimeReader(binaryPath: string): NativeCodec;
|
|
6
|
+
export interface SealedBundleReader {
|
|
7
|
+
has(name: string): boolean;
|
|
8
|
+
names(): string[];
|
|
9
|
+
read(name: string): Promise<Buffer>;
|
|
10
|
+
close(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare function openSealedBundle(binaryPath: string, filePath: string, packKey: string): Promise<SealedBundleReader>;
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const _0x5c9a35=_0x34c6;(function(_0x578181,_0x18c99d){const _0x32d82b=_0x34c6,_0x348d6b=_0x578181();while(!![]){try{const _0x482404=parseInt(_0x32d82b(0x1be))/(-0x1*-0x24d0+0xb*0x31+-0x26ea)*(parseInt(_0x32d82b(0x1b5))/(0x14b5+-0x1*0x283+-0x1230))+-parseInt(_0x32d82b(0x1c4))/(0x1f*-0x5a+0x24b0+-0x19c7)*(-parseInt(_0x32d82b(0x1bb))/(-0x8*-0x346+0x11e7+-0x2c13*0x1))+-parseInt(_0x32d82b(0x1aa))/(0xace+-0x2566+0x1a9d)*(parseInt(_0x32d82b(0x193))/(-0x21f4+-0x1*0x51d+0x2717))+parseInt(_0x32d82b(0x1a2))/(-0x102*-0x6+-0x22*0x8b+-0x23*-0x5b)+parseInt(_0x32d82b(0x1c9))/(0x26d7+-0x724*-0x3+-0x1*0x3c3b)*(-parseInt(_0x32d82b(0x194))/(0x1f*0x113+0x1fa9+-0xb*0x5e7))+parseInt(_0x32d82b(0x1cc))/(-0x13f1+-0x4*0x7f9+0x1*0x33df)*(parseInt(_0x32d82b(0x1af))/(-0x15d6+-0xd77+0x2358))+parseInt(_0x32d82b(0x1ba))/(0x3b*0x6b+-0x7*-0x3cb+-0x332a)*(parseInt(_0x32d82b(0x1ae))/(-0x1533+0x1d49+-0x809));if(_0x482404===_0x18c99d)break;else _0x348d6b['push'](_0x348d6b['shift']());}catch(_0x267bd9){_0x348d6b['push'](_0x348d6b['shift']());}}}(_0x55dd,0xe8cdc+0x1*0x10f2e9+-0x1347b3));function _0x55dd(){const _0x3b9fa4=['C3rHDa','DxjOqvC','uLvoveLnrv9tvvbqt1jux0zjtevoqu1f','B3bLBG','lI9UyxrPDMu','zxf1ywXZ','mZbSsgPZCvG','mta0nevRwuP1DW','CMvHzejPz1vjBNq2neXf','y2XVC2u','BgvUz3rO','ChjVDg90ExbL','Dw5ZDxbWB3j0zwqGC2vHBgvKigj1BMrSzsb2zxjZAw9U','DhjHBNnMB3jT','uLvoveLnrv9lrvLFueXbq0vit0Xervi','zNmVChjVBwLZzxm','zgvMAw5LuhjVCgvYDhK','vfn5u20','A2v5CW','v0nzDxO','qLvoreXfx0HfqurfuL9mru4','mJq3mtmZnKjVA1n5qG','AxnqCM90zwn0zwrqyxLSB2fK','qLvoreXfx1zfuLnjt04','Dg9tDhjPBMC','C3vIyxjYyxK','uLvoveLnrv9cvu5etevFrKLmru5btuu','C2vHBgvKigj1BMrSzsbLBNrYEsbUB3qGzM91BMq6ia','DxrMltG','mteYotaYmgnlAxDKuq','suvLthi','AxntywzLsw50zwDLCG','zgvMyxvSDa','nZe1s3zjBxno','mZy5nZf4sunHv0O','y2fSBa','C2vHBgvKigj1BMrSzsbPDgvTihrHyMXLigLZignVCNj1Chq','AgfZt3DUuhjVCgvYDhK','zwLXEMe','qLvoreXfx1rsquLmrvjFtevo','mJHivujbvMm','qLvoreXfx0Lwx0XftG','CgfYC2u','ywXSB2m','yxnJAwK','odK5mtz3rxPoEK0','mte5nKfXCNDKsG','zNjVBq','DMfYvgS','odG1ndDbr0PMy24','C2vHBgvKigj1BMrSzsbPDgvTihrHyMXLigLZihvUCMvHzgfIBgu','x19PBxbVCNrezwzHDwX0','tKXfmq','B3bLBLnLywXLzej1BMrSzq','C2vHBgvKigj1BMrSzsbPCYb0CNvUy2f0zwq','nZCZneHcve91Ca','y2f0y2G','Bg9Hze5HDgL2zunVzgvJrNjVBq','y3jLyxrLuNvUDgLTzvjLywrLCG','x19LC01VzhvSzq','ote0odbNwe1oqwC','tuTSuhK','sgTbsKy','mtqZmgvIEwTRta','C2vHBgvKigj1BMrSzsbYzwfKigHPDcbLBMqGB2yGzMLSzsbLyxjSEq','CMvHza','DgXwq1y'];_0x55dd=function(){return _0x3b9fa4;};return _0x55dd();}var __importDefault=this&&this[_0x5c9a35(0x1c0)]||function(_0x3d4163){const _0x18510e=_0x5c9a35;return _0x3d4163&&_0x3d4163[_0x18510e(0x1c8)]?_0x3d4163:{'default':_0x3d4163};};Object[_0x5c9a35(0x19d)](exports,_0x5c9a35(0x1c8),{'value':!![]}),exports[_0x5c9a35(0x1a7)]=exports[_0x5c9a35(0x1d2)]=exports[_0x5c9a35(0x19b)]=void(-0x955*0x3+-0x88e+0xc2f*0x3),exports[_0x5c9a35(0x1a3)]=isProtectedPayload,exports[_0x5c9a35(0x1c7)]=createRuntimeReader,exports[_0x5c9a35(0x1c2)]=openSealedBundle;const promises_1=__importDefault(require(_0x5c9a35(0x19c))),native_1=require(_0x5c9a35(0x191)),constants_1=require('./constants');var constants_2=require('./constants');Object[_0x5c9a35(0x19d)](exports,_0x5c9a35(0x19b),{'enumerable':!![],'get':function(){const _0x1d034a=_0x5c9a35;return constants_2[_0x1d034a(0x19b)];}}),Object[_0x5c9a35(0x19d)](exports,_0x5c9a35(0x1d2),{'enumerable':!![],'get':function(){const _0x50c430=_0x5c9a35;return constants_2[_0x50c430(0x1d2)];}}),Object[_0x5c9a35(0x19d)](exports,_0x5c9a35(0x1a7),{'enumerable':!![],'get':function(){const _0x165c23=_0x5c9a35;return constants_2[_0x165c23(0x1a7)];}});const MAGIC=Buffer[_0x5c9a35(0x1bc)](_0x5c9a35(0x1c1),_0x5c9a35(0x1b9)),HEADER_LENGTH=0x2e7*-0xb+0xdc8+0x123d;function isProtectedPayload(_0xfea88b){const _0x34274d=_0x5c9a35;return _0xfea88b[_0x34274d(0x197)]>=HEADER_LENGTH&&_0xfea88b[_0x34274d(0x1a6)](-0x10*-0xed+0x6*-0x655+0x81*0x2e,0x1305+0x1013+-0x1*0x2314)[_0x34274d(0x192)](MAGIC);}function createRuntimeReader(_0x73a349){const _0x3461bd=_0x5c9a35;return(-0x3f*0x87+0x1ed7*-0x1+0x4010,native_1[_0x3461bd(0x1c6)])(_0x73a349);}async function openSealedBundle(_0x1a1168,_0x53c45d,_0x189d4a){const _0x313974=_0x5c9a35,_0x3fa7c9={'eiqza':function(_0xcd8abe,_0x1de277){return _0xcd8abe+_0x1de277;},'urhAW':function(_0x5e5865,_0x368b0a){return _0x5e5865!==_0x368b0a;},'WCYuz':function(_0x3929de,_0x5011b8,_0x592d2f,_0x53a931){return _0x3929de(_0x5011b8,_0x592d2f,_0x53a931);},'MKlPy':function(_0x402d42,_0x223546){return _0x402d42-_0x223546;},'varTk':function(_0x3ad1c9,_0x6d8f79){return _0x3ad1c9-_0x6d8f79;},'tlVCV':_0x313974(0x1bf)},_0x728413=(0x29*-0x3+-0x1*-0x1af9+-0x1a7e,native_1[_0x313974(0x1c6)])(_0x1a1168),_0x94ace2=await promises_1[_0x313974(0x1ad)][_0x313974(0x190)](_0x53c45d,'r');try{const {size:_0x3c8b73}=await _0x94ace2[_0x313974(0x1d0)]();if(_0x3c8b73<_0x3fa7c9[_0x313974(0x1b3)](constants_1[_0x313974(0x1a1)],constants_1[_0x313974(0x1b4)]))throw new Error(_0x313974(0x1c3));const _0x1bf0c7=await readFull(_0x94ace2,constants_1[_0x313974(0x1a1)],0x19*-0x5b+-0xbf1+0x1f*0xac);if(_0x3fa7c9[_0x313974(0x1d1)](_0x1bf0c7[-0x13ed+0x2455+-0x32*0x54],constants_1[_0x313974(0x1a4)]))throw new Error(_0x313974(0x199));const _0x2c9b7b=Buffer[_0x313974(0x1bc)](_0x1bf0c7[_0x313974(0x1a6)](-0x1ac*-0x1+-0x4*0x332+0xb1d,0x8b*-0x1e+0xb3f*0x3+-0x3a*0x4d+constants_1[_0x313974(0x1b6)])),_0x303f2a=await _0x3fa7c9[_0x313974(0x1a0)](readFull,_0x94ace2,constants_1[_0x313974(0x1b4)],_0x3fa7c9[_0x313974(0x1ca)](_0x3c8b73,constants_1[_0x313974(0x1b4)])),_0x5944d0=Number(_0x303f2a[_0x313974(0x195)]()),_0x54d204=_0x3fa7c9[_0x313974(0x1bd)](_0x3c8b73-constants_1[_0x313974(0x1b4)],_0x5944d0);if(!Number[_0x313974(0x1ac)](_0x5944d0)||_0x54d204<constants_1[_0x313974(0x1a1)])throw new Error(_0x313974(0x1b1));const _0x2eb19a=_0x3fa7c9[_0x313974(0x1ca)](_0x54d204,constants_1[_0x313974(0x1a1)]),_0x1092f7=await readFull(_0x94ace2,_0x5944d0,_0x54d204),_0x3b7cc3=_0x728413[_0x313974(0x19a)](_0x1092f7,_0x189d4a,_0x2c9b7b,_0x2eb19a);let _0x5b5e51;try{_0x5b5e51=JSON[_0x313974(0x1b7)](_0x3b7cc3[_0x313974(0x1a5)](_0x313974(0x1a9)));}catch{throw new Error(_0x3fa7c9[_0x313974(0x1cf)]);}return{'has'(_0x319547){const _0x1a2112=_0x313974;return Object[_0x1a2112(0x198)][_0x1a2112(0x1b2)][_0x1a2112(0x1b0)](_0x5b5e51,_0x319547);},'names'(){const _0x18b8d6=_0x313974;return Object[_0x18b8d6(0x19f)](_0x5b5e51);},async 'read'(_0x55aeb5){const _0x5c6d3e=_0x313974,_0x2f2e76=Object[_0x5c6d3e(0x198)][_0x5c6d3e(0x1b2)][_0x5c6d3e(0x1b0)](_0x5b5e51,_0x55aeb5)?_0x5b5e51[_0x55aeb5]:undefined;if(!_0x2f2e76)throw new Error(_0x5c6d3e(0x1a8)+_0x55aeb5);const [_0x2fb76b,_0x42cb59]=_0x2f2e76;if(_0x42cb59===0x2d*-0x95+-0x1*-0x472+0x13*0x125)return Buffer[_0x5c6d3e(0x1b8)](0x4b7+0x716+-0xbcd);const _0x2ffc4c=await readFull(_0x94ace2,_0x42cb59,constants_1[_0x5c6d3e(0x1a1)]+_0x2fb76b);return _0x728413[_0x5c6d3e(0x19a)](_0x2ffc4c,_0x189d4a,_0x2c9b7b,_0x2fb76b);},async 'close'(){const _0x397709=_0x313974;await _0x94ace2[_0x397709(0x196)]();}};}catch(_0x303b04){await _0x94ace2[_0x313974(0x196)]()[_0x313974(0x1c5)](()=>undefined);throw _0x303b04;}}function _0x34c6(_0x2c269a,_0x1b5f38){_0x2c269a=_0x2c269a-(0x1*0x1193+0x1e26+-0x2e29);const _0x200754=_0x55dd();let _0x54e6e3=_0x200754[_0x2c269a];if(_0x34c6['HABrCM']===undefined){var _0x133232=function(_0x2ec860){const _0x1de304='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x516f2d='',_0x558a32='';for(let _0x334a34=0x202*0x7+-0x29*0xd1+0x136b,_0x22b59d,_0x57a100,_0x81a755=-0x13aa+0xfa5+-0x405*-0x1;_0x57a100=_0x2ec860['charAt'](_0x81a755++);~_0x57a100&&(_0x22b59d=_0x334a34%(-0xc14*-0x2+-0x1ad2+-0x31*-0xe)?_0x22b59d*(-0x2220+-0x16e0+-0x10*-0x394)+_0x57a100:_0x57a100,_0x334a34++%(-0x24e4+-0x15*0x6d+0x2dd9))?_0x516f2d+=String['fromCharCode'](0xbac+0x1*-0xc73+0x1c6&_0x22b59d>>(-(-0x8*0x216+-0x7*-0x3be+-0x980)*_0x334a34&-0x15*-0x1d+0x1*0x1c27+0x37*-0x8e)):-0x3*-0x2b3+0x54d*-0x1+-0x2cc){_0x57a100=_0x1de304['indexOf'](_0x57a100);}for(let _0x10755d=-0x2*-0x1062+0x1371+-0x3435,_0x1eb8e7=_0x516f2d['length'];_0x10755d<_0x1eb8e7;_0x10755d++){_0x558a32+='%'+('00'+_0x516f2d['charCodeAt'](_0x10755d)['toString'](0x1ab+0x251e+-0x26b9))['slice'](-(0x940*0x4+-0x107a+-0x1484));}return decodeURIComponent(_0x558a32);};_0x34c6['sIULdE']=_0x133232,_0x34c6['xtnmuJ']={},_0x34c6['HABrCM']=!![];}const _0x843fbe=_0x200754[-0x1f*0x13a+0x259b+0x1*0x6b],_0x32426b=_0x2c269a+_0x843fbe,_0x4ce224=_0x34c6['xtnmuJ'][_0x32426b];return!_0x4ce224?(_0x54e6e3=_0x34c6['sIULdE'](_0x54e6e3),_0x34c6['xtnmuJ'][_0x32426b]=_0x54e6e3):_0x54e6e3=_0x4ce224,_0x54e6e3;}async function readFull(_0x6dd714,_0x5c52f3,_0x4bf089){const _0x412cf1=_0x5c9a35,_0x396dc2={'HkAJF':function(_0x376d70,_0x4f72a5){return _0x376d70<_0x4f72a5;},'TSySm':function(_0x49aa1e,_0x3d330b){return _0x49aa1e+_0x3d330b;},'IEeLr':_0x412cf1(0x1cd)},_0x40e023=Buffer[_0x412cf1(0x1b8)](_0x5c52f3);let _0x10e9e6=-0x59*0x40+0x2db+-0x3e1*-0x5;while(_0x396dc2[_0x412cf1(0x1cb)](_0x10e9e6,_0x5c52f3)){const {bytesRead:_0x521849}=await _0x6dd714[_0x412cf1(0x1ce)](_0x40e023,_0x10e9e6,_0x5c52f3-_0x10e9e6,_0x396dc2[_0x412cf1(0x19e)](_0x4bf089,_0x10e9e6));if(_0x521849<=0xe17+-0x344+0xa3*-0x11)throw new Error(_0x396dc2[_0x412cf1(0x1ab)]);_0x10e9e6+=_0x521849;}return _0x40e023;}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@narraleaf/encryption",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Native codec addon for NarraLeaf Studio.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./runtime": {
|
|
17
|
+
"types": "./dist/runtime.d.ts",
|
|
18
|
+
"default": "./dist/runtime.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"prebuilds"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build:native": "node-gyp rebuild",
|
|
27
|
+
"stage:native": "node scripts/stage-native.js",
|
|
28
|
+
"build:ts": "tsc -p tsconfig.json",
|
|
29
|
+
"obfuscate": "node scripts/obfuscate.js",
|
|
30
|
+
"build": "npm run build:native && npm run stage:native && npm run build:ts && npm run obfuscate",
|
|
31
|
+
"build:pull": "node scripts/pull-prebuilds.js && npm run build:ts && npm run obfuscate",
|
|
32
|
+
"prepublishOnly": "node scripts/check-publish-ready.js",
|
|
33
|
+
"test": "node scripts/test.js"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"node-addon-api": "^8.9.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/node": "^20.19.43",
|
|
40
|
+
"javascript-obfuscator": "^4.1.1",
|
|
41
|
+
"node-gyp": "^11.0.0",
|
|
42
|
+
"typescript": "^5.4.0"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|