dsh-snowbreak-heimdall 3.8.3 → 3.8.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/lib/index.js +18 -9
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -18,7 +18,7 @@ import { fileURLToPath } from 'node:url';
18
18
  const requireFromHere = createRequire(import.meta.url);
19
19
 
20
20
  const ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
21
- const VERSION = '3.8.3';
21
+ const VERSION = '3.8.4';
22
22
  let restartPrompted = false;
23
23
  const INSTALL = path.join(process.env.LOCALAPPDATA || '', 'Programs', 'DeepSeek Harness');
24
24
  const DEFAULT_RESOURCES = process.env.HEIMDALL_RESOURCES
@@ -65,18 +65,27 @@ function writeState(patch) {
65
65
  }
66
66
 
67
67
  function sha256File(file) {
68
- const hash = createHash('sha256');
69
- const handle = fs.openSync(file, 'r');
68
+ // Inside Electron the fs module is asar-aware: opening app.asar itself is
69
+ // resolved as a lookup *inside* the archive and fails with ENOENT. Disable
70
+ // asar handling around the raw read.
71
+ const previousNoAsar = process.noAsar;
72
+ process.noAsar = true;
70
73
  try {
71
- const buffer = Buffer.allocUnsafe(4 * 1024 * 1024);
72
- let read = 0;
73
- while ((read = fs.readSync(handle, buffer, 0, buffer.length, null)) > 0) {
74
- hash.update(buffer.subarray(0, read));
74
+ const hash = createHash('sha256');
75
+ const handle = fs.openSync(file, 'r');
76
+ try {
77
+ const buffer = Buffer.allocUnsafe(4 * 1024 * 1024);
78
+ let read = 0;
79
+ while ((read = fs.readSync(handle, buffer, 0, buffer.length, null)) > 0) {
80
+ hash.update(buffer.subarray(0, read));
81
+ }
82
+ } finally {
83
+ try { fs.closeSync(handle); } catch (_) { /* closed */ }
75
84
  }
85
+ return hash.digest('hex');
76
86
  } finally {
77
- try { fs.closeSync(handle); } catch (_) { /* closed */ }
87
+ process.noAsar = previousNoAsar;
78
88
  }
79
- return hash.digest('hex');
80
89
  }
81
90
 
82
91
  const STATUS_TTL_MS = 60 * 1000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-snowbreak-heimdall",
3
- "version": "3.8.3",
3
+ "version": "3.8.4",
4
4
  "description": "《尘白禁区》海姆达尔终端 / 世界树公司源码级皮肤:加载画面、双主题、菜单/侧栏/图标,插件仅在加载后播放启动动画。Windows / DSH 0.2.2-rc.x。",
5
5
  "type": "module",
6
6
  "license": "MIT",