使用 javascript-obfuscator 做标识符重命名、字符串数组编码和常量拆分。
在 vite build 后增加生产环境混淆步骤,开发环境保持源码可读。
关闭 sourcemap,避免直接暴露原始源码。
当前主包约 1.7 MB,建议先拆出第三方依赖,再只混淆应用自身代码,而不是整个 dist。
This commit is contained in:
tianmo committed 2026-10-27 16:40:33 +08:00
1 parent 5f7e30063b
commit c93ec671da
10 files changed
+2825 -1332

No files matched your search

+1
View File
@@ -0,0 +1 @@
const _0x6745e=_0x2734;(function(_0x30306b,_0x4c7c61){const _0x5224d2=_0x2734,_0x500037=_0x30306b();while(!![]){try{const _0x58f533=parseInt(_0x5224d2(0xc9e))/0x1+parseInt(_0x5224d2(0xbb0))/0x2+-parseInt(_0x5224d2(0x340c))/0x3+parseInt(_0x5224d2(0x242f))/0x4*(parseInt(_0x5224d2(0x10a0))/0x5)+-parseInt(_0x5224d2(0xe1a))/0x6*(-parseInt(_0x5224d2(0x2a62))/0x7)+parseInt(_0x5224d2(0x4415))/0x8*(parseInt(_0x5224d2(0x2cdc))/0x9)+-parseInt(_0x5224d2(0x57b))/0xa*(parseInt(_0x5224d2(0x3c39))/0xb);if(_0x58f533===_0x4c7c61)break;else _0x500037['push'](_0x500037['shift']());}catch(_0x4eadc6){_0x500037['push'](_0x500037['shift']());}}}(_0x20d3,0xe722f));var rs=Object[_0x6745e(0x1fdb)+_0x6745e(0x4ee)],ls=(_0x547dc4,_0x38174b,_0x57c5fb)=>_0x38174b in _0x547dc4?rs(_0x547dc4,_0x38174b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x57c5fb}):_0x547dc4[_0x38174b]=_0x57c5fb,Ce=(_0x903dc,_0x107213,_0x2fb672)=>ls(_0x903dc,typeof _0x107213!=_0x6745e(0x40e1)?_0x107213+'':_0x107213,_0x2fb672);import{T as _0x3e2c3a,S as _0x5bf396,C as _0x2f02fc,G as _0x33e108,a as _0x43cad4,d as _0x3d1027,c as _0x3d14e6,w as _0xf3faed,b as _0x16b5f3,M as _0x2cb91c,A as _0x2d49c1,e as _0x1ab80e,f as _0x20bcab,g as _0x43efd7,h as _0x2b82f5,i as _0x4bfdab,j as _0x40f021,m as _0x31d65e,r as _0x2952a2,o as _0x56c168,k as _0x3928b5,l as _0x4fe1ee,n as _0x17ae06,p as _0x3a5021,q as _0x18d237,s as _0x1f3c1f,t as _0xb25afa,u as _0x3e9337,v as _0x543239,x as _0x175a7b,y as _0x335e74,z as _0x59a7fc,B as _0x179c28,D as _0x27ddd8,E as _0x373927,F as _0x16b72b,H as _0x41ba7c,I as _0x36da41,J as _0x5b2b40,K as _0x27e8db,L as _0x309117,N as _0x5b137a,O as _0x1f06a0,P as _0x45fb80,Q as _0x3dea51,R as _0xb06d2b,U as _0x49f829,V as _0x1a9dbc,W as _0x4c04f1,X as _0x324ffd,Y as _0x596d6f,Z as _0x533955,_ as _0x266932,$ as _0x28215a,a0 as _0x82a8f8,a1 as _0x4b1a8d,a2 as _0x176b3d,a3 as _0x52c85b,a4 as _0x32f0ce,a5 as _0x575b80,a6 as _0x2b5d05,a7 as _0x3bd644,a8 as _0x359bef,a9 as _0x394213,aa as _0x3ca422,ab as _0x15e420,ac as _0x5b0576,ad as _0x3a90d8,ae as _0x2435b7,af as _0x10dcb3,ag as _0x18f9ca,ah as _0x5c3f46,ai as _0x5deaa1}from'./vendor-Cb_6CYmx.js';(function(){const _0x5e3fa3=_0x6745e,_0x11b289=document[_0x5e3fa3(0x3f7f)+_0x5e3fa3(0x14e9)]('link')[_0x5e3fa3(0x9dd)];if(_0x11b289&&_0x11b289[_0x5e3fa3(0x23dd)]&&_0x11b289[_0x5e3fa3(0x23dd)](_0x5e3fa3(0x17fe)+_0x5e3fa3(0xc9b)))return;for(const _0x5d022d of document[_0x5e3fa3(0x1caf)+_0x5e3fa3(0x1a16)](_0x5e3fa3(0x3a54)+_0x5e3fa3(0x1f6b)+'preload\x22'+']'))_0xed15f8(_0x5d022d);new MutationObserver(_0x59da43=>{const _0x3d30a7=_0x5e3fa3;for(const _0x51068d of _0x59da43)if(_0x51068d[_0x3d30a7(0x2e8)]===_0x3d30a7(0x2182)+'t'){for(const _0x8360b6 of _0x51068d[_0x3d30a7(0x3c71)+'es'])_0x8360b6['tagName']===_0x3d30a7(0x1e2a)&&_0x8360b6['rel']===_0x3d30a7(0x17fe)+_0x3d30a7(0xc9b)&&_0xed15f8(_0x8360b6);}})[_0x5e3fa3(0x3282)](document,{'childList':!0x0,'subtree':!0x0});function _0x22f022(_0x392db1){const _0x3784e2=_0x5e3fa3,_0x4048ff={};return _0x392db1[_0x3784e2(0x1b54)+'y']&&(_0x4048ff['integrit'+'y']=_0x392db1['integrit'+'y']),_0x392db1[_0x3784e2(0x3883)+_0x3784e2(0x10de)]&&(_0x4048ff[_0x3784e2(0x3883)+_0x3784e2(0x10de)]=_0x392db1[_0x3784e2(0x3883)+_0x3784e2(0x10de)]),_0x392db1[_0x3784e2(0x277)+_0x3784e2(0x26c5)]===_0x3784e2(0x1eda)+_0x3784e2(0xb6c)?_0x4048ff[_0x3784e2(0x42bd)+'als']=_0x3784e2(0x2e00):_0x392db1['crossOri'+_0x3784e2(0x26c5)]===_0x3784e2(0x4529)+'s'?_0x4048ff[_0x3784e2(0x42bd)+'als']=_0x3784e2(0x2b08):_0x4048ff[_0x3784e2(0x42bd)+_0x3784e2(0xf1e)]=_0x3784e2(0x3e5d)+_0x3784e2(0x26c5),_0x4048ff;}function _0xed15f8(_0x535aaa){const _0x482fca=_0x5e3fa3;if(_0x535aaa['ep'])return;_0x535aaa['ep']=!0x0;const _0x591e48=_0x22f022(_0x535aaa);fetch(_0x535aaa[_0x482fca(0x310d)],_0x591e48);}}());function Fn(_0x2a16b5,_0x3bf737){const _0x312386=_0x6745e,_0x45b854=Math['max'](0x0,Number(_0x2a16b5)||0x0),_0x304f69=Math[_0x312386(0x4231)](0x0,Number(_0x3bf737)||0x0);return{'inner':Math[_0x312386(0x2819)](_0x45b854,_0x304f69),'outer':Math[_0x312386(0x4231)](_0x45b854,_0x304f69)};}function Oi(_0x4d7951){const _0x5d9feb=_0x6745e,_0x6febc5=Math[_0x5d9feb(0x4231)](0x0,Number(_0x4d7951['outerRec'+'tW'])||0x0),_0x1b86a0=Math[_0x5d9feb(0x4231)](0x0,Number(_0x4d7951[_0x5d9feb(0x3cfb)+'tH'])||0x0);return{'innerW':Math['min'](_0x6febc5,Math[_0x5d9feb(0x4231)](0x0,Number(_0x4d7951[_0x5d9feb(0x13b0)+'tW'])||0x0)),'innerH':Math['min'](_0x1b86a0,Math[_0x5d9feb(0x4231)](0x0,Number(_0x4d7951[_0x5d9feb(0x13b0)+'tH'])||0x0)),'outerW':_0x6febc5,'outerH':_0x1b86a0};}function js(_0x1ff123,_0x5244b4,_0x42d0d9,_0x378b3a,_0xed0b18){const _0x1ccdff=_0x6745e;if(_0x1ff123===_0x1ccdff(0x34bb))return _0xed0b18();const _0x569e3e=Math[_0x1ccdff(0x4231)](0x1,Math['round'](_0x42d0d9)),_0x45f303=Math[_0x1ccdff(0x4231)](0x0,Math[_0x1ccdff(0x1f1f)](_0x5244b4))%_0x569e3e;return _0x378b3a?_0x45f303/_0x569e3e:_0x569e3e<=0x1?0.5:_0x45f303/(_0x569e3e-0x1);}function Io(_0x1a7009,_0x21fd66,_0x836600,_0x20f357){const _0x4b9dff=_0x6745e,_0x1d95ac=Math[_0x4Line truncated