fast-cocos 1.1.6 → 1.1.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/dist/xor/src/xor.js +3 -2
- package/package.json +1 -1
package/dist/xor/src/xor.js
CHANGED
|
@@ -62,10 +62,10 @@ function encryptFile(opts) {
|
|
|
62
62
|
const rawData = fs_1.default.readFileSync(opts.inputPath, { encoding: "binary" });
|
|
63
63
|
const fileSign = rawData.slice(0, finalSign.length);
|
|
64
64
|
if (fileSign == finalSign) {
|
|
65
|
-
console.log(
|
|
65
|
+
console.log(`跳过(已加密): ${opts.inputPath}`);
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
const encrypted =
|
|
68
|
+
const encrypted = finalSign + xor(rawData, finalKey);
|
|
69
69
|
fs_1.default.writeFileSync(destPath, encrypted, { encoding: "binary" });
|
|
70
70
|
console.info("\x1b[32m%s\x1b[0m", `加密: ${opts.inputPath} -> ${destPath} [sign:${finalSign}, key:${finalKey.substring(0, 4)}...]`);
|
|
71
71
|
}
|
|
@@ -93,6 +93,7 @@ function decryptFile(opts) {
|
|
|
93
93
|
const destPath = out;
|
|
94
94
|
const encryptedData = fs_1.default.readFileSync(opts.inputPath, { encoding: "binary" });
|
|
95
95
|
const fileSign = encryptedData.slice(0, finalSign.length);
|
|
96
|
+
console.log("文件签名:", fileSign);
|
|
96
97
|
if (fileSign != finalSign) {
|
|
97
98
|
console.info("\x1b[31m%s\x1b[0m", `跳过(签名不匹配): ${opts.inputPath}`);
|
|
98
99
|
return false;
|