@picoxr/web-cli-core
Version:
Core Library to generate, build and sign TWA projects
1 lines • 5.14 kB
JavaScript
;const _0x1bc432=_0x43d7;function _0x3a04(){const _0x2f5860=['fullName','-keyalg\x20RSA','-storepass\x20\x22','organizationalUnit','10kkBlLG','info','10928600VFRckb','keytool','2482878sdjnXx','set','keypassword','length','substring','jdkHelper','stringify','4gkklSd','KeyTool','1277379icGuUu','path','startsWith','../util','SHA1','execute','7PaFxhj','defineProperty','escapeDName','Generating\x20Signature\x20with\x20keyOptions:','36XzPBgP','2CVKapu','password','2102553dPZfPx','existsSync','split','debug','Couldn\x27t\x20find\x20signing\x20key\x20at\x20\x22','escapeDoubleQuotedShellString','organization','-keystore\x20\x22','-keypass\x20\x22','2586372qItefC','replace','\x5c$1','unlink','-dname\x20\x22','-list','21787415ZiNDPC','ConsoleLog','cn=','Signing\x20Key\x20created\x20successfully','createSigningKey','forEach','getEnv','-genkeypair','list','ou=','log','-alias\x20\x22','parseKeyInfo','-validity\x2020000','13127917roNlin','trim','10AMpqlV'];_0x3a04=function(){return _0x2f5860;};return _0x3a04();}(function(_0x5d04c2,_0x22865e){const _0x2fa23d=_0x43d7,_0x1caef4=_0x5d04c2();while(!![]){try{const _0x1ccf9c=parseInt(_0x2fa23d(0x1f9))/0x1*(-parseInt(_0x2fa23d(0x204))/0x2)+parseInt(_0x2fa23d(0x1f0))/0x3*(parseInt(_0x2fa23d(0x1f7))/0x4)+-parseInt(_0x2fa23d(0x1e7))/0x5*(parseInt(_0x2fa23d(0x20f))/0x6)+parseInt(_0x2fa23d(0x1ff))/0x7*(-parseInt(_0x2fa23d(0x1ee))/0x8)+-parseInt(_0x2fa23d(0x206))/0x9*(parseInt(_0x2fa23d(0x1ec))/0xa)+-parseInt(_0x2fa23d(0x1e5))/0xb+-parseInt(_0x2fa23d(0x203))/0xc*(-parseInt(_0x2fa23d(0x215))/0xd);if(_0x1ccf9c===_0x22865e)break;else _0x1caef4['push'](_0x1caef4['shift']());}catch(_0x2327e1){_0x1caef4['push'](_0x1caef4['shift']());}}}(_0x3a04,0xe14e1));Object[_0x1bc432(0x200)](exports,'__esModule',{'value':!![]}),exports['KeyTool']=void 0x0;function _0x43d7(_0x392d4e,_0x498de9){const _0x3a0422=_0x3a04();return _0x43d7=function(_0x43d7c3,_0x54566a){_0x43d7c3=_0x43d7c3-0x1da;let _0x55c4fe=_0x3a0422[_0x43d7c3];return _0x55c4fe;},_0x43d7(_0x392d4e,_0x498de9);}const fs_1=require('fs'),util_1=require(_0x1bc432(0x1fc)),Log_1=require('../Log');class KeyTool{constructor(_0x5bd6c5,_0x3786e1=new Log_1[(_0x1bc432(0x216))](_0x1bc432(0x1ef))){const _0x1de534=_0x1bc432;this[_0x1de534(0x1f5)]=_0x5bd6c5,this[_0x1de534(0x1e1)]=_0x3786e1;}async[_0x1bc432(0x1db)](_0x72513a,_0xd1c533=![]){const _0x1cbcb5=_0x1bc432;this[_0x1cbcb5(0x1e1)][_0x1cbcb5(0x209)](_0x1cbcb5(0x202),JSON[_0x1cbcb5(0x1f6)](_0x72513a));if((0x0,fs_1[_0x1cbcb5(0x207)])(_0x72513a[_0x1cbcb5(0x1fa)])){if(_0xd1c533)await fs_1['promises'][_0x1cbcb5(0x212)](_0x72513a['path']);else return;}const _0x165a75=_0x1cbcb5(0x217)+KeyTool[_0x1cbcb5(0x201)](_0x72513a[_0x1cbcb5(0x1e8)])+',\x20'+(_0x1cbcb5(0x1e0)+KeyTool[_0x1cbcb5(0x201)](_0x72513a[_0x1cbcb5(0x1eb)])+',\x20')+('o='+KeyTool[_0x1cbcb5(0x201)](_0x72513a[_0x1cbcb5(0x20c)])+',\x20')+('c='+KeyTool[_0x1cbcb5(0x201)](_0x72513a['country'])),_0x328efd=[_0x1cbcb5(0x1ef),_0x1cbcb5(0x1de),_0x1cbcb5(0x213)+_0x165a75+'\x22','-alias\x20\x22'+(0x0,util_1[_0x1cbcb5(0x20b)])(_0x72513a['alias'])+'\x22',_0x1cbcb5(0x20e)+(0x0,util_1[_0x1cbcb5(0x20b)])(_0x72513a[_0x1cbcb5(0x1f2)])+'\x22',_0x1cbcb5(0x20d)+(0x0,util_1[_0x1cbcb5(0x20b)])(_0x72513a[_0x1cbcb5(0x1fa)])+'\x22',_0x1cbcb5(0x1ea)+(0x0,util_1[_0x1cbcb5(0x20b)])(_0x72513a[_0x1cbcb5(0x205)])+'\x22',_0x1cbcb5(0x1e4),_0x1cbcb5(0x1e9)],_0xf84028=this[_0x1cbcb5(0x1f5)][_0x1cbcb5(0x1dd)]();await(0x0,util_1[_0x1cbcb5(0x1fe)])(_0x328efd,_0xf84028),this[_0x1cbcb5(0x1e1)][_0x1cbcb5(0x1ed)](_0x1cbcb5(0x1da));}async['list'](_0x17a7b5){const _0x57655e=_0x1bc432;if(!(0x0,fs_1[_0x57655e(0x207)])(_0x17a7b5[_0x57655e(0x1fa)]))throw new Error(_0x57655e(0x20a)+_0x17a7b5['path']+'\x22');const _0x319be8=[_0x57655e(0x1ef),'-J-Duser.language=en',_0x57655e(0x214),'-v',_0x57655e(0x20d)+(0x0,util_1[_0x57655e(0x20b)])(_0x17a7b5[_0x57655e(0x1fa)])+'\x22',_0x57655e(0x1e2)+(0x0,util_1['escapeDoubleQuotedShellString'])(_0x17a7b5['alias'])+'\x22','-storepass\x20\x22'+(0x0,util_1[_0x57655e(0x20b)])(_0x17a7b5['password'])+'\x22',_0x57655e(0x20e)+(0x0,util_1[_0x57655e(0x20b)])(_0x17a7b5['keypassword'])+'\x22'],_0x4c6637=this[_0x57655e(0x1f5)]['getEnv'](),_0x5bcc8d=await(0x0,util_1['execute'])(_0x319be8,_0x4c6637);return _0x5bcc8d['stdout'];}async['keyInfo'](_0x4e4077){const _0x4c8d92=_0x1bc432,_0x2dba9d=await this[_0x4c8d92(0x1df)](_0x4e4077);return KeyTool[_0x4c8d92(0x1e3)](_0x2dba9d);}static['escapeDName'](_0x214c3d){const _0x177cf0=_0x1bc432;return _0x214c3d[_0x177cf0(0x210)](/([,$`])/g,_0x177cf0(0x211));}static[_0x1bc432(0x1e3)](_0x4ee01a){const _0x2d1bf8=_0x1bc432,_0x19e17f=_0x4ee01a[_0x2d1bf8(0x208)]('\x0a'),_0x2c6b5d=new Map(),_0x388290=[_0x2d1bf8(0x1fd),'SHA256'];return _0x19e17f['forEach'](_0x237a83=>{const _0x55c57a=_0x2d1bf8;_0x237a83=_0x237a83[_0x55c57a(0x1e6)](),_0x388290[_0x55c57a(0x1dc)](_0x132173=>{const _0x2cb5cd=_0x55c57a;if(_0x237a83[_0x2cb5cd(0x1fb)](_0x132173)){const _0x1eef0d=_0x237a83[_0x2cb5cd(0x1f4)](_0x132173[_0x2cb5cd(0x1f3)]+0x1,_0x237a83[_0x2cb5cd(0x1f3)])[_0x2cb5cd(0x1e6)]();_0x2c6b5d[_0x2cb5cd(0x1f1)](_0x132173,_0x1eef0d);}});}),{'fingerprints':_0x2c6b5d};}}exports[_0x1bc432(0x1f8)]=KeyTool;