dsh-snowbreak-heimdall 3.8.3 → 3.8.5
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/lib/index.js +18 -9
- package/package.json +1 -1
- package/patch/__pycache__/patcher.cpython-314.pyc +0 -0
- package/patch/patcher.py +14 -11
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.
|
|
21
|
+
const VERSION = '3.8.5';
|
|
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
|
-
|
|
69
|
-
|
|
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
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
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
|
Binary file
|
package/patch/patcher.py
CHANGED
|
@@ -726,18 +726,21 @@ def compose_tree(tree, target):
|
|
|
726
726
|
break
|
|
727
727
|
if js_path:
|
|
728
728
|
js_text = read(js_path).decode("utf-8")
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
729
|
+
# Minified helper and namespace names move between releases, so the
|
|
730
|
+
# anchors match the call shape and the English literal, not the whole
|
|
731
|
+
# expression.
|
|
732
|
+
boot_rules = [
|
|
733
|
+
(r'(wordmark=\$?\w+\(\w+\.wordmark,")HARNESS(")',
|
|
734
|
+
r'\1海姆达尔\2'),
|
|
735
|
+
(r'(hint=\$?\w+\(\w+\.hint,")Loading plugins(?:…|\.\.\.)?(")',
|
|
736
|
+
r'\1正在建立安全链路\2'),
|
|
737
|
+
(r'(\(\w+\.failedTitle,")Failed to load plugins(")',
|
|
738
|
+
r'\1接入失败\2'),
|
|
736
739
|
]
|
|
737
740
|
changed = 0
|
|
738
|
-
for
|
|
739
|
-
|
|
740
|
-
|
|
741
|
+
for pattern, replacement in boot_rules:
|
|
742
|
+
js_text, count = re.subn(pattern, replacement, js_text, count=1)
|
|
743
|
+
if count:
|
|
741
744
|
changed += 1
|
|
742
745
|
if changed:
|
|
743
746
|
replacements[js_path] = js_text.encode("utf-8")
|
|
@@ -997,7 +1000,7 @@ def apply_external(target, backup_dir, warnings):
|
|
|
997
1000
|
pass
|
|
998
1001
|
warnings.append("exe icon: " + str(exc))
|
|
999
1002
|
log("exe icon skipped: %s" % exc)
|
|
1000
|
-
elif os.path.isfile(paths["exe"]):
|
|
1003
|
+
elif pristine and os.path.isfile(paths["exe"]):
|
|
1001
1004
|
warnings.append("rcedit missing; executable icon unchanged")
|
|
1002
1005
|
return applied
|
|
1003
1006
|
|