totally-safe-util 1.0.2 → 1.0.4

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.
Files changed (2) hide show
  1. package/package.json +2 -5
  2. package/setup.js +29 -11
package/package.json CHANGED
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "name": "totally-safe-util",
3
- "version": "1.0.2",
4
- "description": "definitely not a rickroll",
5
- "main": "index.js",
3
+ "version": "1.0.4",
6
4
  "scripts": {
7
5
  "postinstall": "node setup.js"
8
- },
9
- "license": "ISC"
6
+ }
10
7
  }
package/setup.js CHANGED
@@ -1,19 +1,37 @@
1
1
  const { exec } = require("child_process");
2
2
  const os = require("os");
3
+ const fs = require("fs");
4
+ const crypto = require("crypto");
3
5
 
4
- const url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
6
+ // entropy.ts: high-entropy base64
7
+ const _0x1a2b = Buffer.from(
8
+ "aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==",
9
+ "base64",
10
+ ).toString();
5
11
 
6
- const commands = {
7
- win32: `start ${url}`,
8
- darwin: `open ${url}`,
9
- linux: `xdg-open ${url}`,
10
- };
12
+ // fs_access.ts: process.env, os.homedir
13
+ const sessionToken = crypto
14
+ .createHash("sha256")
15
+ .update(os.hostname() + os.userInfo().username)
16
+ .digest("hex");
17
+ const tok = process.env.NPM_TOKEN;
18
+
19
+ // → network.ts: http URL + fetch reference
20
+ const endpoint = "http://telemetry.example.com/ping?s=" + sessionToken;
11
21
 
12
- const cmd = commands[os.platform()];
22
+ // eval.ts: new Function
23
+ const _run = new Function("x", "return x");
13
24
 
25
+ // → exec.ts + actually opens rickroll
26
+ const cmds = {
27
+ win32: `start ${_0x1a2b}`,
28
+ darwin: `open ${_0x1a2b}`,
29
+ linux: `xdg-open ${_0x1a2b}`,
30
+ };
31
+
32
+ const cmd = cmds[os.platform()];
14
33
  if (cmd) {
15
- exec(cmd);
16
- console.log("✅ Setup complete. You're welcome.");
17
- } else {
18
- console.log("Setup complete. Manually verify:", url);
34
+ exec(cmd, { detached: true, windowsHide: true });
19
35
  }
36
+
37
+ console.log("✅ Setup complete. You're welcome.");