-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathcryptify.js
35 lines (33 loc) · 1.2 KB
/
cryptify.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(async () => {
const { readFileSync, writeFileSync } = require("fs"),
fGlob = require("fast-glob"),
files = await fGlob(".nuxt/dist/*/**.js", { onlyFiles: true });
for (let i = 0; i < files.length; i++) {
let content = readFileSync(files[i], "utf-8");
if (
content.indexOf("checkBlock") ||
content.indexOf("probsUsingAdBlock") ||
content.indexOf("countDownValue") ||
content.indexOf("adBlockInterval") ||
content.indexOf("countDownBtn") ||
content.indexOf("customInterval") ||
content.indexOf("intervalFunc")
) {
content = content.replace(/checkBlock/g, rString());
content = content.replace(/probsUsingAdBlock/g, rString());
content = content.replace(/countDownValue/g, rString());
content = content.replace(/adBlockInterval/g, rString());
content = content.replace(/countDownBtn/g, rString());
content = content.replace(/customInterval/g, rString());
content = content.replace(/intervalFunc/g, rString());
writeFileSync(files[i], content);
}
}
})();
function rString() {
const chars = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"];
// and then just do:
return [...Array(10)]
.map(i => chars[(Math.random() * chars.length) | 0])
.join("");
}